+2016-07-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ obstack: pacify GCC 6 with -Wnull-dereference
+ Problem reported by Assaf Gordon in:
+ http://lists.gnu.org/archive/html/bug-gnulib/2016-07/msg00028.html
+ * lib/obstack.c, lib/obstack.h (obstack_alloc_failed_handler):
+ Declare with __attribute_noreturn__.
+ * lib/obstack.h (__attribute_noreturn__): New macro.
+
2016-07-13 Eric Blake <eblake@redhat.com>
doc: mention glibc, OS X, Cygwin [S]SIZE_MAX buglet
abort gracefully or use longjump - but shouldn't return. This
variable by default points to the internal function
'print_and_abort'. */
-void (*obstack_alloc_failed_handler) (void) = print_and_abort;
+__attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
+ = print_and_abort;
# endif /* !_OBSTACK_NO_ERROR_HANDLER */
#endif /* !_OBSTACK_ELIDE_CODE */
# define __attribute_pure__ _GL_ATTRIBUTE_PURE
#endif
+/* Not the same as _Noreturn, since it also works with function pointers. */
+#ifndef __attribute_noreturn__
+# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
+# define __attribute_noreturn__ __attribute__ ((__noreturn__))
+# else
+# define __attribute_noreturn__
+# endif
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
more memory. This can be set to a user defined function which
should either abort gracefully or use longjump - but shouldn't
return. The default action is to print a message and abort. */
-extern void (*obstack_alloc_failed_handler) (void);
+extern __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void);
/* Exit value used when 'print_and_abort' is used. */
extern int obstack_exit_failure;