Pádraig Brady wrote: > > CC src/cksum-crctab.o > > In file included from ./lib/time.h:50, > > from /usr/include/sys/time.h:421, > > from ./lib/sys/time.h:39, > > from /usr/include/sys/select.h:23, > > from ./lib/sys/select.h:36, > > from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h:631, > > from ./lib/sys/types.h:39, > > from ./lib/stdint.h:105, > > from src/crctab.c:1: > > ./lib/stddef.h:175: error: syntax error before "void" > > Ah, this isn't a gnulib issue. > crctab.c in coreutils didn't include <config.h>
While we document that #include <config.h> is a necessity, in <https://www.gnu.org/software/gnulib/manual/html_node/Source-changes.html>, we don't enforce it well. It would have been better if, instead of getting a syntax error, you would have gotten an error "Please include config.h first.". We already have such errors in a few places, but apparently not in enough places. With the attached patch, you would have gotten an error "Please include config.h first." from - the included lib/sys/select.h, - the included lib/sys/time.h, - the included lib/time.h, - the included lib/stddef.h on that particular platform. It is well possible — and even the intention — that this patch causes compilation errors in packages that before compiled fine, on a particular platform. It will force the package maintainers to add '#include <config.h>' in some (hopefully most) of the missing places and thus increase the portability, i.e. reduce the risk of other platform-related compilation errors. 2023-04-12 Bruno Haible <br...@clisp.org> Add more reminders to include <config.h>. * m4/gnulib-common.m4 (gl_COMMON): In config.h, define _GL_CONFIG_H_INCLUDED. * lib/acl-internal.h: Test _GL_CONFIG_H_INCLUDED instead of _GL_INLINE_HEADER_BEGIN. * lib/alignalloc.h: Likewise. * lib/argp-fmtstream.h: Likewise. * lib/argp.h: Likewise. * lib/binary-io.h: Likewise. * lib/bitrotate.h: Likewise. * lib/c-ctype.h: Likewise. * lib/count-leading-zeros.h: Likewise. * lib/count-one-bits.h: Likewise. * lib/count-trailing-zeros.h: Likewise. * lib/eealloc.h: Likewise. * lib/execinfo.in.h: Likewise. * lib/gethrxtime.h: Likewise. * lib/gl_list.h: Likewise. * lib/gl_map.h: Likewise. * lib/gl_omap.h: Likewise. * lib/gl_openssl.h: Likewise. * lib/gl_oset.h: Likewise. * lib/gl_set.h: Likewise. * lib/gl_xlist.h: Likewise. * lib/gl_xmap.h: Likewise. * lib/gl_xomap.h: Likewise. * lib/gl_xoset.h: Likewise. * lib/gl_xset.h: Likewise. * lib/gl_xsublist.h: Likewise. * lib/glthread/cond.h: Likewise. * lib/hamt.h: Likewise. * lib/ialloc.h: Likewise. * lib/math.in.h: Likewise. * lib/mbchar.h: Likewise. * lib/mbfile.h: Likewise. * lib/mbiter.h: Likewise. * lib/mbuiter.h: Likewise. * lib/openat.h: Likewise. * lib/pipe-filter-aux.h: Likewise. * lib/priv-set.h: Likewise. * lib/safe-alloc.h: Likewise. * lib/savewd.h: Likewise. * lib/se-context.in.h: Likewise. * lib/se-label.in.h: Likewise. * lib/se-selinux.in.h: Likewise. * lib/sig-handler.h: Likewise. * lib/stat-time.h: Likewise. * lib/string-desc-quotearg.h: Likewise. * lib/string-desc.h: Likewise. * lib/sys_socket.in.h: Likewise. * lib/timespec.h: Likewise. * lib/u64.h: Likewise. * lib/uchar.in.h: Likewise. * lib/unistd.in.h: Likewise. * lib/utimens.h: Likewise. * lib/wctype.in.h: Likewise. * lib/xalloc.h: Likewise. * lib/xbinary-io.h: Likewise. * lib/xsize.h: Likewise. * lib/xstring-desc.h: Likewise. * lib/xtime.h: Likewise. * lib/acl.h: Check that config.h was already included. * lib/alignof.h: Likewise. * lib/argmatch.h: Likewise. * lib/argv-iter.h: Likewise. * lib/arpa_inet.in.h: Likewise. * lib/attribute.h: Likewise. * lib/backupfile.h: Likewise. * lib/base32.h: Likewise. * lib/base64.h: Likewise. * lib/basename-lgpl.h: Likewise. * lib/bitset.h: Likewise. * lib/bitsetv.h: Likewise. * lib/c-snprintf.h: Likewise. * lib/c-stack.h: Likewise. * lib/c-strcase.h: Likewise. * lib/c-vasnprintf.h: Likewise. * lib/c-vasprintf.h: Likewise. * lib/c-vsnprintf.h: Likewise. * lib/c-xvasprintf.h: Likewise. * lib/canon-host.h: Likewise. * lib/canonicalize.h: Likewise. * lib/clean-temp.h: Likewise. * lib/concat-filename.h: Likewise. * lib/ctype.in.h: Likewise. * lib/dfa.h: Likewise. * lib/di-set.h: Likewise. * lib/dirent-safer.h: Likewise. * lib/dirent.in.h: Likewise. * lib/dirname.h: Likewise. * lib/eloop-threshold.h: Likewise. * lib/error.in.h: Likewise. * lib/exclude.h: Likewise. * lib/fatal-signal.h: Likewise. * lib/fcntl.in.h: Likewise. * lib/file-type.h: Likewise. * lib/filenamecat.h: Likewise. * lib/filevercmp.h: Likewise. * lib/flexmember.h: Likewise. * lib/fnmatch.in.h: Likewise. * lib/fpending.h: Likewise. * lib/freadable.h: Likewise. * lib/freadahead.h: Likewise. * lib/freading.h: Likewise. * lib/fts_.h: Likewise. * lib/fwritable.h: Likewise. * lib/fwriting.h: Likewise. * lib/gc.h: Likewise. * lib/get_progname_of.h: Likewise. * lib/glob.in.h: Likewise. * lib/glthread/thread.h: Likewise. * lib/hash-pjw-bare.h: Likewise. * lib/hash-pjw.h: Likewise. * lib/hash-triple.h: Likewise. * lib/hash.h: Likewise. * lib/i-ring.h: Likewise. * lib/iconv.in.h: Likewise. * lib/ino-map.h: Likewise. * lib/inttostr.h: Likewise. * lib/inttypes.in.h: Likewise. * lib/javaversion.h: Likewise. * lib/langinfo.in.h: Likewise. * lib/locale.in.h: Likewise. * lib/localename.h: Likewise. * lib/malloc.in.h: Likewise. * lib/malloca.h: Likewise. * lib/memcasecmp.h: Likewise. * lib/memchr2.h: Likewise. * lib/memcmp2.h: Likewise. * lib/modechange.h: Likewise. * lib/monetary.in.h: Likewise. * lib/mountlist.h: Likewise. * lib/netdb.in.h: Likewise. * lib/obstack.h: Likewise. * lib/opendirat.h: Likewise. * lib/pagealign_alloc.h: Likewise. * lib/pipe-filter.h: Likewise. * lib/poll.in.h: Likewise. * lib/pthread.in.h: Likewise. * lib/pty.in.h: Likewise. * lib/quotearg.h: Likewise. * lib/read-file.h: Likewise. * lib/readline.h: Likewise. * lib/readutmp.h: Likewise. * lib/regex-quote.h: Likewise. * lib/relocatable.h: Likewise. * lib/savedir.h: Likewise. * lib/sched.in.h: Likewise. * lib/search.in.h: Likewise. * lib/sh-quote.h: Likewise. * lib/signal.in.h: Likewise. * lib/sigpipe-die.h: Likewise. * lib/sockets.h: Likewise. * lib/spawn.in.h: Likewise. * lib/ssfmalloc.h: Likewise. * lib/stack.h: Likewise. * lib/stdalign.in.h: Likewise. * lib/stdarg.in.h: Likewise. * lib/stddef.in.h: Likewise. * lib/stdio-safer.h: Likewise. * lib/stdio.in.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/stdnoreturn.in.h: Likewise. * lib/strerror-override.h: Likewise. * lib/striconv.h: Likewise. * lib/striconveh.h: Likewise. * lib/striconveha.h: Likewise. * lib/string-buffer.h: Likewise. * lib/string.in.h: Likewise. * lib/strings.in.h: Likewise. * lib/strnlen1.h: Likewise. * lib/sys_file.in.h: Likewise. * lib/sys_ioctl.in.h: Likewise. * lib/sys_random.in.h: Likewise. * lib/sys_resource.in.h: Likewise. * lib/sys_select.in.h: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_time.in.h: Likewise. * lib/sys_times.in.h: Likewise. * lib/sys_utsname.in.h: Likewise. * lib/sys_wait.in.h: Likewise. * lib/system-quote.h: Likewise. * lib/term-style-control.h: Likewise. * lib/termios.in.h: Likewise. * lib/textstyle.in.h: Likewise. * lib/threads.in.h: Likewise. * lib/time.in.h: Likewise. * lib/trim.h: Likewise. * lib/utime.in.h: Likewise. * lib/utmp.in.h: Likewise. * lib/vasnprintf.h: Likewise. * lib/verror.h: Likewise. * lib/version-etc.h: Likewise. * lib/wchar.in.h: Likewise. * lib/windows-spawn.h: Likewise. * lib/windows-thread.h: Likewise. * lib/xgetcwd.h: Likewise. * lib/xgetdomainname.h: Likewise. * lib/xgethostname.h: Likewise. * lib/xmalloca.h: Likewise. * lib/xmemdup0.h: Likewise. * lib/xprintf.h: Likewise. * lib/xreadlink.h: Likewise. * lib/xstriconv.h: Likewise. * lib/xstriconveh.h: Likewise. * lib/xstrndup.h: Likewise. * lib/xstrtol-error.h: Likewise. * lib/xvasprintf.h: Likewise. * Makefile (config_h_MACROS*): New variables. (sc_check_config_h_reminder): New rule.
From 8ad7bc671475d3291df10a1a1d64fddfd30e5175 Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@clisp.org> Date: Wed, 12 Apr 2023 14:49:29 +0200 Subject: [PATCH] Add more reminders to include <config.h>. * m4/gnulib-common.m4 (gl_COMMON): In config.h, define _GL_CONFIG_H_INCLUDED. * lib/acl-internal.h: Test _GL_CONFIG_H_INCLUDED instead of _GL_INLINE_HEADER_BEGIN. * lib/alignalloc.h: Likewise. * lib/argp-fmtstream.h: Likewise. * lib/argp.h: Likewise. * lib/binary-io.h: Likewise. * lib/bitrotate.h: Likewise. * lib/c-ctype.h: Likewise. * lib/count-leading-zeros.h: Likewise. * lib/count-one-bits.h: Likewise. * lib/count-trailing-zeros.h: Likewise. * lib/eealloc.h: Likewise. * lib/execinfo.in.h: Likewise. * lib/gethrxtime.h: Likewise. * lib/gl_list.h: Likewise. * lib/gl_map.h: Likewise. * lib/gl_omap.h: Likewise. * lib/gl_openssl.h: Likewise. * lib/gl_oset.h: Likewise. * lib/gl_set.h: Likewise. * lib/gl_xlist.h: Likewise. * lib/gl_xmap.h: Likewise. * lib/gl_xomap.h: Likewise. * lib/gl_xoset.h: Likewise. * lib/gl_xset.h: Likewise. * lib/gl_xsublist.h: Likewise. * lib/glthread/cond.h: Likewise. * lib/hamt.h: Likewise. * lib/ialloc.h: Likewise. * lib/math.in.h: Likewise. * lib/mbchar.h: Likewise. * lib/mbfile.h: Likewise. * lib/mbiter.h: Likewise. * lib/mbuiter.h: Likewise. * lib/openat.h: Likewise. * lib/pipe-filter-aux.h: Likewise. * lib/priv-set.h: Likewise. * lib/safe-alloc.h: Likewise. * lib/savewd.h: Likewise. * lib/se-context.in.h: Likewise. * lib/se-label.in.h: Likewise. * lib/se-selinux.in.h: Likewise. * lib/sig-handler.h: Likewise. * lib/stat-time.h: Likewise. * lib/string-desc-quotearg.h: Likewise. * lib/string-desc.h: Likewise. * lib/sys_socket.in.h: Likewise. * lib/timespec.h: Likewise. * lib/u64.h: Likewise. * lib/uchar.in.h: Likewise. * lib/unistd.in.h: Likewise. * lib/utimens.h: Likewise. * lib/wctype.in.h: Likewise. * lib/xalloc.h: Likewise. * lib/xbinary-io.h: Likewise. * lib/xsize.h: Likewise. * lib/xstring-desc.h: Likewise. * lib/xtime.h: Likewise. * lib/acl.h: Check that config.h was already included. * lib/alignof.h: Likewise. * lib/argmatch.h: Likewise. * lib/argv-iter.h: Likewise. * lib/arpa_inet.in.h: Likewise. * lib/attribute.h: Likewise. * lib/backupfile.h: Likewise. * lib/base32.h: Likewise. * lib/base64.h: Likewise. * lib/basename-lgpl.h: Likewise. * lib/bitset.h: Likewise. * lib/bitsetv.h: Likewise. * lib/c-snprintf.h: Likewise. * lib/c-stack.h: Likewise. * lib/c-strcase.h: Likewise. * lib/c-vasnprintf.h: Likewise. * lib/c-vasprintf.h: Likewise. * lib/c-vsnprintf.h: Likewise. * lib/c-xvasprintf.h: Likewise. * lib/canon-host.h: Likewise. * lib/canonicalize.h: Likewise. * lib/clean-temp.h: Likewise. * lib/concat-filename.h: Likewise. * lib/ctype.in.h: Likewise. * lib/dfa.h: Likewise. * lib/di-set.h: Likewise. * lib/dirent-safer.h: Likewise. * lib/dirent.in.h: Likewise. * lib/dirname.h: Likewise. * lib/eloop-threshold.h: Likewise. * lib/error.in.h: Likewise. * lib/exclude.h: Likewise. * lib/fatal-signal.h: Likewise. * lib/fcntl.in.h: Likewise. * lib/file-type.h: Likewise. * lib/filenamecat.h: Likewise. * lib/filevercmp.h: Likewise. * lib/flexmember.h: Likewise. * lib/fnmatch.in.h: Likewise. * lib/fpending.h: Likewise. * lib/freadable.h: Likewise. * lib/freadahead.h: Likewise. * lib/freading.h: Likewise. * lib/fts_.h: Likewise. * lib/fwritable.h: Likewise. * lib/fwriting.h: Likewise. * lib/gc.h: Likewise. * lib/get_progname_of.h: Likewise. * lib/glob.in.h: Likewise. * lib/glthread/thread.h: Likewise. * lib/hash-pjw-bare.h: Likewise. * lib/hash-pjw.h: Likewise. * lib/hash-triple.h: Likewise. * lib/hash.h: Likewise. * lib/i-ring.h: Likewise. * lib/iconv.in.h: Likewise. * lib/ino-map.h: Likewise. * lib/inttostr.h: Likewise. * lib/inttypes.in.h: Likewise. * lib/javaversion.h: Likewise. * lib/langinfo.in.h: Likewise. * lib/locale.in.h: Likewise. * lib/localename.h: Likewise. * lib/malloc.in.h: Likewise. * lib/malloca.h: Likewise. * lib/memcasecmp.h: Likewise. * lib/memchr2.h: Likewise. * lib/memcmp2.h: Likewise. * lib/modechange.h: Likewise. * lib/monetary.in.h: Likewise. * lib/mountlist.h: Likewise. * lib/netdb.in.h: Likewise. * lib/obstack.h: Likewise. * lib/opendirat.h: Likewise. * lib/pagealign_alloc.h: Likewise. * lib/pipe-filter.h: Likewise. * lib/poll.in.h: Likewise. * lib/pthread.in.h: Likewise. * lib/pty.in.h: Likewise. * lib/quotearg.h: Likewise. * lib/read-file.h: Likewise. * lib/readline.h: Likewise. * lib/readutmp.h: Likewise. * lib/regex-quote.h: Likewise. * lib/relocatable.h: Likewise. * lib/savedir.h: Likewise. * lib/sched.in.h: Likewise. * lib/search.in.h: Likewise. * lib/sh-quote.h: Likewise. * lib/signal.in.h: Likewise. * lib/sigpipe-die.h: Likewise. * lib/sockets.h: Likewise. * lib/spawn.in.h: Likewise. * lib/ssfmalloc.h: Likewise. * lib/stack.h: Likewise. * lib/stdalign.in.h: Likewise. * lib/stdarg.in.h: Likewise. * lib/stddef.in.h: Likewise. * lib/stdio-safer.h: Likewise. * lib/stdio.in.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/stdnoreturn.in.h: Likewise. * lib/strerror-override.h: Likewise. * lib/striconv.h: Likewise. * lib/striconveh.h: Likewise. * lib/striconveha.h: Likewise. * lib/string-buffer.h: Likewise. * lib/string.in.h: Likewise. * lib/strings.in.h: Likewise. * lib/strnlen1.h: Likewise. * lib/sys_file.in.h: Likewise. * lib/sys_ioctl.in.h: Likewise. * lib/sys_random.in.h: Likewise. * lib/sys_resource.in.h: Likewise. * lib/sys_select.in.h: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_time.in.h: Likewise. * lib/sys_times.in.h: Likewise. * lib/sys_utsname.in.h: Likewise. * lib/sys_wait.in.h: Likewise. * lib/system-quote.h: Likewise. * lib/term-style-control.h: Likewise. * lib/termios.in.h: Likewise. * lib/textstyle.in.h: Likewise. * lib/threads.in.h: Likewise. * lib/time.in.h: Likewise. * lib/trim.h: Likewise. * lib/utime.in.h: Likewise. * lib/utmp.in.h: Likewise. * lib/vasnprintf.h: Likewise. * lib/verror.h: Likewise. * lib/version-etc.h: Likewise. * lib/wchar.in.h: Likewise. * lib/windows-spawn.h: Likewise. * lib/windows-thread.h: Likewise. * lib/xgetcwd.h: Likewise. * lib/xgetdomainname.h: Likewise. * lib/xgethostname.h: Likewise. * lib/xmalloca.h: Likewise. * lib/xmemdup0.h: Likewise. * lib/xprintf.h: Likewise. * lib/xreadlink.h: Likewise. * lib/xstriconv.h: Likewise. * lib/xstriconveh.h: Likewise. * lib/xstrndup.h: Likewise. * lib/xstrtol-error.h: Likewise. * lib/xvasprintf.h: Likewise. * Makefile (config_h_MACROS*): New variables. (sc_check_config_h_reminder): New rule. --- ChangeLog | 213 +++++++++++++++++++++++++++++++++++++ Makefile | 89 ++++++++++++++++ lib/acl-internal.h | 8 +- lib/acl.h | 5 + lib/alignalloc.h | 9 +- lib/alignof.h | 5 + lib/argmatch.h | 5 + lib/argp-fmtstream.h | 9 +- lib/argp.h | 8 +- lib/argv-iter.h | 5 + lib/arpa_inet.in.h | 5 + lib/attribute.h | 15 +++ lib/backupfile.h | 5 + lib/base32.h | 5 + lib/base64.h | 5 + lib/basename-lgpl.h | 5 + lib/binary-io.h | 8 +- lib/bitrotate.h | 8 +- lib/bitset.h | 5 + lib/bitsetv.h | 5 + lib/c-ctype.h | 4 +- lib/c-snprintf.h | 5 + lib/c-stack.h | 9 +- lib/c-strcase.h | 5 + lib/c-vasnprintf.h | 5 + lib/c-vasprintf.h | 5 + lib/c-vsnprintf.h | 5 + lib/c-xvasprintf.h | 5 + lib/canon-host.h | 5 + lib/canonicalize.h | 5 + lib/clean-temp.h | 5 + lib/concat-filename.h | 5 + lib/count-leading-zeros.h | 8 +- lib/count-one-bits.h | 8 +- lib/count-trailing-zeros.h | 8 +- lib/ctype.in.h | 5 + lib/dfa.h | 6 ++ lib/di-set.h | 6 ++ lib/dirent-safer.h | 5 + lib/dirent.in.h | 6 ++ lib/dirname.h | 6 ++ lib/eealloc.h | 9 +- lib/eloop-threshold.h | 5 + lib/error.in.h | 5 + lib/exclude.h | 6 ++ lib/execinfo.in.h | 4 +- lib/fatal-signal.h | 5 + lib/fcntl.in.h | 5 + lib/file-type.h | 5 + lib/filenamecat.h | 5 + lib/filevercmp.h | 5 + lib/flexmember.h | 5 + lib/fnmatch.in.h | 5 + lib/fpending.h | 5 + lib/freadable.h | 5 + lib/freadahead.h | 5 + lib/freading.h | 5 + lib/fts_.h | 5 + lib/fwritable.h | 5 + lib/fwriting.h | 5 + lib/gc.h | 5 + lib/get_progname_of.h | 5 + lib/gethrxtime.h | 8 +- lib/gl_list.h | 9 +- lib/gl_map.h | 9 +- lib/gl_omap.h | 9 +- lib/gl_openssl.h | 8 +- lib/gl_oset.h | 9 +- lib/gl_set.h | 9 +- lib/gl_xlist.h | 9 +- lib/gl_xmap.h | 9 +- lib/gl_xomap.h | 9 +- lib/gl_xoset.h | 9 +- lib/gl_xset.h | 9 +- lib/gl_xsublist.h | 9 +- lib/glob.in.h | 5 + lib/glthread/cond.h | 9 +- lib/glthread/thread.h | 5 + lib/hamt.h | 7 +- lib/hash-pjw-bare.h | 5 + lib/hash-pjw.h | 5 + lib/hash-triple.h | 5 + lib/hash.h | 7 ++ lib/i-ring.h | 5 + lib/ialloc.h | 9 +- lib/iconv.in.h | 5 + lib/ino-map.h | 6 ++ lib/inttostr.h | 5 + lib/inttypes.in.h | 5 + lib/javaversion.h | 5 + lib/langinfo.in.h | 5 + lib/locale.in.h | 5 + lib/localename.h | 5 + lib/malloc.in.h | 5 + lib/malloca.h | 6 ++ lib/math.in.h | 9 +- lib/mbchar.h | 8 +- lib/mbfile.h | 8 +- lib/mbiter.h | 8 +- lib/mbuiter.h | 8 +- lib/memcasecmp.h | 5 + lib/memchr2.h | 5 + lib/memcmp2.h | 5 + lib/modechange.h | 5 + lib/monetary.in.h | 5 + lib/mountlist.h | 5 + lib/netdb.in.h | 5 + lib/obstack.h | 5 + lib/openat.h | 9 +- lib/opendirat.h | 5 + lib/pagealign_alloc.h | 7 ++ lib/pipe-filter-aux.h | 4 +- lib/pipe-filter.h | 5 + lib/poll.in.h | 5 + lib/priv-set.h | 4 +- lib/pthread.in.h | 5 + lib/pty.in.h | 5 + lib/quotearg.h | 5 + lib/read-file.h | 5 + lib/readline.h | 5 + lib/readutmp.h | 5 + lib/regex-quote.h | 5 + lib/relocatable.h | 5 + lib/safe-alloc.h | 9 +- lib/savedir.h | 5 + lib/savewd.h | 10 +- lib/sched.in.h | 5 + lib/se-context.in.h | 11 +- lib/se-label.in.h | 10 +- lib/se-selinux.in.h | 9 +- lib/search.in.h | 5 + lib/sh-quote.h | 5 + lib/sig-handler.h | 8 +- lib/signal.in.h | 5 + lib/sigpipe-die.h | 5 + lib/sockets.h | 5 + lib/spawn.in.h | 5 + lib/ssfmalloc.h | 5 + lib/stack.h | 5 + lib/stat-time.h | 9 +- lib/stdalign.in.h | 5 + lib/stdarg.in.h | 5 + lib/stddef.in.h | 5 + lib/stdio-safer.h | 5 + lib/stdio.in.h | 6 ++ lib/stdlib.in.h | 6 ++ lib/stdnoreturn.in.h | 5 + lib/strerror-override.h | 5 + lib/striconv.h | 5 + lib/striconveh.h | 5 + lib/striconveha.h | 5 + lib/string-buffer.h | 5 + lib/string-desc-quotearg.h | 9 +- lib/string-desc.h | 9 +- lib/string.in.h | 6 ++ lib/strings.in.h | 5 + lib/strnlen1.h | 5 + lib/sys_file.in.h | 5 + lib/sys_ioctl.in.h | 5 + lib/sys_random.in.h | 5 + lib/sys_resource.in.h | 5 + lib/sys_select.in.h | 5 + lib/sys_socket.in.h | 5 +- lib/sys_stat.in.h | 5 + lib/sys_time.in.h | 5 + lib/sys_times.in.h | 5 + lib/sys_utsname.in.h | 5 + lib/sys_wait.in.h | 5 + lib/system-quote.h | 5 + lib/term-style-control.h | 5 + lib/termios.in.h | 5 + lib/textstyle.in.h | 5 + lib/threads.in.h | 5 + lib/time.in.h | 5 + lib/timespec.h | 9 +- lib/trim.h | 5 + lib/u64.h | 8 +- lib/uchar.in.h | 9 +- lib/unistd.in.h | 8 +- lib/utime.in.h | 5 + lib/utimens.h | 8 +- lib/utmp.in.h | 5 + lib/vasnprintf.h | 5 + lib/verror.h | 5 + lib/version-etc.h | 5 + lib/wchar.in.h | 6 ++ lib/wctype.in.h | 8 +- lib/windows-spawn.h | 5 + lib/windows-thread.h | 5 + lib/xalloc.h | 10 +- lib/xbinary-io.h | 8 +- lib/xgetcwd.h | 5 + lib/xgetdomainname.h | 5 + lib/xgethostname.h | 5 + lib/xmalloca.h | 6 ++ lib/xmemdup0.h | 5 + lib/xprintf.h | 5 + lib/xreadlink.h | 5 + lib/xsize.h | 8 +- lib/xstriconv.h | 5 + lib/xstriconveh.h | 5 + lib/xstring-desc.h | 8 +- lib/xstrndup.h | 5 + lib/xstrtol-error.h | 5 + lib/xtime.h | 4 +- lib/xvasprintf.h | 5 + m4/gnulib-common.m4 | 6 +- 207 files changed, 1374 insertions(+), 165 deletions(-) diff --git a/ChangeLog b/ChangeLog index c80d5587e8..21ab60e8a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,216 @@ +2023-04-12 Bruno Haible <br...@clisp.org> + + Add more reminders to include <config.h>. + * m4/gnulib-common.m4 (gl_COMMON): In config.h, define + _GL_CONFIG_H_INCLUDED. + * lib/acl-internal.h: Test _GL_CONFIG_H_INCLUDED instead of + _GL_INLINE_HEADER_BEGIN. + * lib/alignalloc.h: Likewise. + * lib/argp-fmtstream.h: Likewise. + * lib/argp.h: Likewise. + * lib/binary-io.h: Likewise. + * lib/bitrotate.h: Likewise. + * lib/c-ctype.h: Likewise. + * lib/count-leading-zeros.h: Likewise. + * lib/count-one-bits.h: Likewise. + * lib/count-trailing-zeros.h: Likewise. + * lib/eealloc.h: Likewise. + * lib/execinfo.in.h: Likewise. + * lib/gethrxtime.h: Likewise. + * lib/gl_list.h: Likewise. + * lib/gl_map.h: Likewise. + * lib/gl_omap.h: Likewise. + * lib/gl_openssl.h: Likewise. + * lib/gl_oset.h: Likewise. + * lib/gl_set.h: Likewise. + * lib/gl_xlist.h: Likewise. + * lib/gl_xmap.h: Likewise. + * lib/gl_xomap.h: Likewise. + * lib/gl_xoset.h: Likewise. + * lib/gl_xset.h: Likewise. + * lib/gl_xsublist.h: Likewise. + * lib/glthread/cond.h: Likewise. + * lib/hamt.h: Likewise. + * lib/ialloc.h: Likewise. + * lib/math.in.h: Likewise. + * lib/mbchar.h: Likewise. + * lib/mbfile.h: Likewise. + * lib/mbiter.h: Likewise. + * lib/mbuiter.h: Likewise. + * lib/openat.h: Likewise. + * lib/pipe-filter-aux.h: Likewise. + * lib/priv-set.h: Likewise. + * lib/safe-alloc.h: Likewise. + * lib/savewd.h: Likewise. + * lib/se-context.in.h: Likewise. + * lib/se-label.in.h: Likewise. + * lib/se-selinux.in.h: Likewise. + * lib/sig-handler.h: Likewise. + * lib/stat-time.h: Likewise. + * lib/string-desc-quotearg.h: Likewise. + * lib/string-desc.h: Likewise. + * lib/sys_socket.in.h: Likewise. + * lib/timespec.h: Likewise. + * lib/u64.h: Likewise. + * lib/uchar.in.h: Likewise. + * lib/unistd.in.h: Likewise. + * lib/utimens.h: Likewise. + * lib/wctype.in.h: Likewise. + * lib/xalloc.h: Likewise. + * lib/xbinary-io.h: Likewise. + * lib/xsize.h: Likewise. + * lib/xstring-desc.h: Likewise. + * lib/xtime.h: Likewise. + * lib/acl.h: Check that config.h was already included. + * lib/alignof.h: Likewise. + * lib/argmatch.h: Likewise. + * lib/argv-iter.h: Likewise. + * lib/arpa_inet.in.h: Likewise. + * lib/attribute.h: Likewise. + * lib/backupfile.h: Likewise. + * lib/base32.h: Likewise. + * lib/base64.h: Likewise. + * lib/basename-lgpl.h: Likewise. + * lib/bitset.h: Likewise. + * lib/bitsetv.h: Likewise. + * lib/c-snprintf.h: Likewise. + * lib/c-stack.h: Likewise. + * lib/c-strcase.h: Likewise. + * lib/c-vasnprintf.h: Likewise. + * lib/c-vasprintf.h: Likewise. + * lib/c-vsnprintf.h: Likewise. + * lib/c-xvasprintf.h: Likewise. + * lib/canon-host.h: Likewise. + * lib/canonicalize.h: Likewise. + * lib/clean-temp.h: Likewise. + * lib/concat-filename.h: Likewise. + * lib/ctype.in.h: Likewise. + * lib/dfa.h: Likewise. + * lib/di-set.h: Likewise. + * lib/dirent-safer.h: Likewise. + * lib/dirent.in.h: Likewise. + * lib/dirname.h: Likewise. + * lib/eloop-threshold.h: Likewise. + * lib/error.in.h: Likewise. + * lib/exclude.h: Likewise. + * lib/fatal-signal.h: Likewise. + * lib/fcntl.in.h: Likewise. + * lib/file-type.h: Likewise. + * lib/filenamecat.h: Likewise. + * lib/filevercmp.h: Likewise. + * lib/flexmember.h: Likewise. + * lib/fnmatch.in.h: Likewise. + * lib/fpending.h: Likewise. + * lib/freadable.h: Likewise. + * lib/freadahead.h: Likewise. + * lib/freading.h: Likewise. + * lib/fts_.h: Likewise. + * lib/fwritable.h: Likewise. + * lib/fwriting.h: Likewise. + * lib/gc.h: Likewise. + * lib/get_progname_of.h: Likewise. + * lib/glob.in.h: Likewise. + * lib/glthread/thread.h: Likewise. + * lib/hash-pjw-bare.h: Likewise. + * lib/hash-pjw.h: Likewise. + * lib/hash-triple.h: Likewise. + * lib/hash.h: Likewise. + * lib/i-ring.h: Likewise. + * lib/iconv.in.h: Likewise. + * lib/ino-map.h: Likewise. + * lib/inttostr.h: Likewise. + * lib/inttypes.in.h: Likewise. + * lib/javaversion.h: Likewise. + * lib/langinfo.in.h: Likewise. + * lib/locale.in.h: Likewise. + * lib/localename.h: Likewise. + * lib/malloc.in.h: Likewise. + * lib/malloca.h: Likewise. + * lib/memcasecmp.h: Likewise. + * lib/memchr2.h: Likewise. + * lib/memcmp2.h: Likewise. + * lib/modechange.h: Likewise. + * lib/monetary.in.h: Likewise. + * lib/mountlist.h: Likewise. + * lib/netdb.in.h: Likewise. + * lib/obstack.h: Likewise. + * lib/opendirat.h: Likewise. + * lib/pagealign_alloc.h: Likewise. + * lib/pipe-filter.h: Likewise. + * lib/poll.in.h: Likewise. + * lib/pthread.in.h: Likewise. + * lib/pty.in.h: Likewise. + * lib/quotearg.h: Likewise. + * lib/read-file.h: Likewise. + * lib/readline.h: Likewise. + * lib/readutmp.h: Likewise. + * lib/regex-quote.h: Likewise. + * lib/relocatable.h: Likewise. + * lib/savedir.h: Likewise. + * lib/sched.in.h: Likewise. + * lib/search.in.h: Likewise. + * lib/sh-quote.h: Likewise. + * lib/signal.in.h: Likewise. + * lib/sigpipe-die.h: Likewise. + * lib/sockets.h: Likewise. + * lib/spawn.in.h: Likewise. + * lib/ssfmalloc.h: Likewise. + * lib/stack.h: Likewise. + * lib/stdalign.in.h: Likewise. + * lib/stdarg.in.h: Likewise. + * lib/stddef.in.h: Likewise. + * lib/stdio-safer.h: Likewise. + * lib/stdio.in.h: Likewise. + * lib/stdlib.in.h: Likewise. + * lib/stdnoreturn.in.h: Likewise. + * lib/strerror-override.h: Likewise. + * lib/striconv.h: Likewise. + * lib/striconveh.h: Likewise. + * lib/striconveha.h: Likewise. + * lib/string-buffer.h: Likewise. + * lib/string.in.h: Likewise. + * lib/strings.in.h: Likewise. + * lib/strnlen1.h: Likewise. + * lib/sys_file.in.h: Likewise. + * lib/sys_ioctl.in.h: Likewise. + * lib/sys_random.in.h: Likewise. + * lib/sys_resource.in.h: Likewise. + * lib/sys_select.in.h: Likewise. + * lib/sys_stat.in.h: Likewise. + * lib/sys_time.in.h: Likewise. + * lib/sys_times.in.h: Likewise. + * lib/sys_utsname.in.h: Likewise. + * lib/sys_wait.in.h: Likewise. + * lib/system-quote.h: Likewise. + * lib/term-style-control.h: Likewise. + * lib/termios.in.h: Likewise. + * lib/textstyle.in.h: Likewise. + * lib/threads.in.h: Likewise. + * lib/time.in.h: Likewise. + * lib/trim.h: Likewise. + * lib/utime.in.h: Likewise. + * lib/utmp.in.h: Likewise. + * lib/vasnprintf.h: Likewise. + * lib/verror.h: Likewise. + * lib/version-etc.h: Likewise. + * lib/wchar.in.h: Likewise. + * lib/windows-spawn.h: Likewise. + * lib/windows-thread.h: Likewise. + * lib/xgetcwd.h: Likewise. + * lib/xgetdomainname.h: Likewise. + * lib/xgethostname.h: Likewise. + * lib/xmalloca.h: Likewise. + * lib/xmemdup0.h: Likewise. + * lib/xprintf.h: Likewise. + * lib/xreadlink.h: Likewise. + * lib/xstriconv.h: Likewise. + * lib/xstriconveh.h: Likewise. + * lib/xstrndup.h: Likewise. + * lib/xstrtol-error.h: Likewise. + * lib/xvasprintf.h: Likewise. + * Makefile (config_h_MACROS*): New variables. + (sc_check_config_h_reminder): New rule. + 2023-04-11 Paul Eggert <egg...@cs.ucla.edu> doc: update year2038 list further diff --git a/Makefile b/Makefile index 1044869450..76e3b5cc54 100644 --- a/Makefile +++ b/Makefile @@ -138,6 +138,95 @@ sc_check_sym_list: <(sed -n /^_intprops_name/,/^_intprops_syms_re/p top/maint.mk \ |sed '/^_/d;s/^ //;s/ *\\$$//') + +# List of C macros defined through AH_VERBATIM in m4/extern-inline.m4: +config_h_MACROS1 = \ + _GL_INLINE \ + _GL_EXTERN_INLINE \ + _GL_INLINE_HEADER_BEGIN \ + _GL_INLINE_HEADER_END +# List of C macros defined through AH_VERBATIM in m4/gnulib-common.m4: +config_h_MACROS2 = \ + _GL_GNUC_PREREQ \ + _Noreturn \ + _GL_ATTRIBUTE_ALLOC_SIZE \ + _GL_ATTRIBUTE_ALWAYS_INLINE \ + _GL_ATTRIBUTE_ARTIFICIAL \ + _GL_ATTRIBUTE_COLD \ + _GL_ATTRIBUTE_CONST \ + _GL_ATTRIBUTE_DEALLOC \ + _GL_ATTRIBUTE_DEPRECATED \ + _GL_ATTRIBUTE_ERROR \ + _GL_ATTRIBUTE_WARNING \ + _GL_ATTRIBUTE_EXTERNALLY_VISIBLE \ + _GL_ATTRIBUTE_FALLTHROUGH \ + _GL_ATTRIBUTE_FORMAT \ + _GL_ATTRIBUTE_LEAF \ + _GL_ATTRIBUTE_MALLOC \ + _GL_ATTRIBUTE_MAY_ALIAS \ + _GL_ATTRIBUTE_MAYBE_UNUSED \ + _GL_UNUSED \ + _GL_ATTRIBUTE_NODISCARD \ + _GL_ATTRIBUTE_NOINLINE \ + _GL_ATTRIBUTE_NONNULL \ + _GL_ATTRIBUTE_NONSTRING \ + _GL_ATTRIBUTE_NOTHROW \ + _GL_ATTRIBUTE_PACKED \ + _GL_ATTRIBUTE_PURE \ + _GL_ATTRIBUTE_RETURNS_NONNULL \ + _GL_ATTRIBUTE_SENTINEL \ + _GL_ATTRIBUTE_UNUSED \ + _GL_UNUSED_LABEL \ + _GL_BEGIN_C_LINKAGE \ + _GL_END_C_LINKAGE \ + _GL_ASYNC_SAFE \ + _GL_CMP +# List of C macros defined through AH_VERBATIM in m4/nullptr.m4: +config_h_MACROS3 = \ + nullptr +# List of C macros defined through AH_VERBATIM in m4/posixcheck.m4: +config_h_MACROS4 = \ + GNULIB_POSIXCHECK +# List of C macros defined through AH_VERBATIM in m4/sh-filename.m4: +config_h_MACROS5 = \ + BOURNE_SHELL +# List of C macros defined through AH_VERBATIM in m4/stdalign.m4: +config_h_MACROS6 = \ + alignof \ + alignas +# List of C macros defined through AH_VERBATIM in m4/stdarg.m4: +config_h_MACROS7 = \ + va_copy +# List of C macros defined through AH_VERBATIM in m4/threads_h.m4: +config_h_MACROS8 = \ + _Thread_local +# List of C macros defined through AH_VERBATIM (only the most important ones): +config_h_MACROS = \ + $(config_h_MACROS1) $(config_h_MACROS2) $(config_h_MACROS3) \ + $(config_h_MACROS4) $(config_h_MACROS5) $(config_h_MACROS6) \ + $(config_h_MACROS7) $(config_h_MACROS8) + +# Ensure that .h files that use macros from config.h contain a reminder to +# include <config.h>. +sc_check_config_h_reminder: + fail=0; \ + for file in `grep -l -F -w -f <(for macro in $(config_h_MACROS); do echo $$macro; done) lib/*.h lib/*/*.h`; do \ + : "Filter out .h files that are not public header files of their respective module."; \ + include_pattern='[<"]'`echo $$file | sed -e 's,^lib/,,' -e 's,[.]in[.]h,.h,' -e 's,_,[/_],g' -e 's,[.],[.],g'`'[>"]' ; \ + if ./gnulib-tool --extract-include-directive `./gnulib-tool --find $$file` | grep "$$include_pattern" >/dev/null; then \ + grep '# *error "Please include config[.]h first[.]"' $$file >/dev/null \ + || { echo -n "File $$file lacks a config.h reminder. Needed for:"; \ + for macro in $(config_h_MACROS); do \ + if grep -F -w $$macro $$file >/dev/null; then echo -n " $$macro"; fi; \ + done; \ + echo; \ + fail=1; \ + }; \ + fi; \ + done; \ + exit $$fail + + # Ensure that the copyright statements in files and in the module descriptions # are consistent. sc_check_copyright: diff --git a/lib/acl-internal.h b/lib/acl-internal.h index c97e847cdc..496e41d7b2 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -17,6 +17,11 @@ Written by Paul Eggert, Andreas Grünbacher, and Bruno Haible. */ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "acl.h" #include <stdlib.h> @@ -60,9 +65,6 @@ extern int aclsort (int, int, struct acl *); # define fchmod(fd, mode) (-1) #endif -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef ACL_INTERNAL_INLINE # define ACL_INTERNAL_INLINE _GL_INLINE diff --git a/lib/acl.h b/lib/acl.h index 58e5797179..0d02120055 100644 --- a/lib/acl.h +++ b/lib/acl.h @@ -20,6 +20,11 @@ #ifndef _GL_ACL_H #define _GL_ACL_H 1 +/* This file uses _GL_ATTRIBUTE_CONST. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <sys/types.h> #include <sys/stat.h> diff --git a/lib/alignalloc.h b/lib/alignalloc.h index eacf47880a..1574e26c92 100644 --- a/lib/alignalloc.h +++ b/lib/alignalloc.h @@ -20,13 +20,16 @@ #ifndef ALIGNALLOC_H_ #define ALIGNALLOC_H_ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_ALLOC_SIZE, + _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <errno.h> #include <stdlib.h> #include "idx.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef ALIGNALLOC_INLINE # define ALIGNALLOC_INLINE _GL_INLINE diff --git a/lib/alignof.h b/lib/alignof.h index 2ded1c7884..a790972763 100644 --- a/lib/alignof.h +++ b/lib/alignof.h @@ -17,6 +17,11 @@ #ifndef _ALIGNOF_H #define _ALIGNOF_H +/* This file uses alignof. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> /* alignof_slot (TYPE) diff --git a/lib/argmatch.h b/lib/argmatch.h index f18127fc96..9e8d217d6d 100644 --- a/lib/argmatch.h +++ b/lib/argmatch.h @@ -22,6 +22,11 @@ #ifndef ARGMATCH_H_ # define ARGMATCH_H_ 1 +/* This file uses _GL_ATTRIBUTE_PURE. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <limits.h> # include <stddef.h> # include <stdio.h> diff --git a/lib/argp-fmtstream.h b/lib/argp-fmtstream.h index 3a42e372f3..5738551255 100644 --- a/lib/argp-fmtstream.h +++ b/lib/argp-fmtstream.h @@ -24,6 +24,12 @@ #ifndef _ARGP_FMTSTREAM_H #define _ARGP_FMTSTREAM_H +/* This file uses _GL_INLINE_HEADER_BEGIN, __GL_INLINE, _GL_ATTRIBUTE_DEALLOC, + _GL_ATTRIBUTE_FORMAT. */ +#if !_LIBC && !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> #include <string.h> #include <unistd.h> @@ -187,9 +193,6 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); #define __argp_fmtstream_point argp_fmtstream_point #define __argp_fmtstream_update _argp_fmtstream_update #define __argp_fmtstream_ensure _argp_fmtstream_ensure -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef ARGP_FS_EI # define ARGP_FS_EI _GL_INLINE diff --git a/lib/argp.h b/lib/argp.h index ae0edd390e..7de939a2a1 100644 --- a/lib/argp.h +++ b/lib/argp.h @@ -19,6 +19,11 @@ #ifndef _ARGP_H #define _ARGP_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_FORMAT. */ +#if !_LIBC && !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> #include <ctype.h> #include <getopt.h> @@ -590,9 +595,6 @@ extern void *__argp_input (const struct argp *__restrict __argp, # define __argp_state_help argp_state_help # define __option_is_short _option_is_short # define __option_is_end _option_is_end -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN # ifndef ARGP_EI # define ARGP_EI _GL_INLINE diff --git a/lib/argv-iter.h b/lib/argv-iter.h index d420ded808..d2d986c20a 100644 --- a/lib/argv-iter.h +++ b/lib/argv-iter.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> /* Definition of _GL_ARG_NONNULL. */ diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h index 80e6713fdd..6df3901c07 100644 --- a/lib/arpa_inet.in.h +++ b/lib/arpa_inet.in.h @@ -49,6 +49,11 @@ #ifndef _@GUARD_PREFIX@_ARPA_INET_H #define _@GUARD_PREFIX@_ARPA_INET_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get all possible declarations of inet_ntop() and inet_pton(). */ #if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \ && @HAVE_WS2TCPIP_H@ diff --git a/lib/attribute.h b/lib/attribute.h index 130644d879..9464fde0f3 100644 --- a/lib/attribute.h +++ b/lib/attribute.h @@ -41,6 +41,21 @@ These names begin with 'ATTRIBUTE_' to avoid name clashes. */ +/* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_ALWAYS_INLINE, + _GL_ATTRIBUTE_ARTIFICIAL, _GL_ATTRIBUTE_COLD, _GL_ATTRIBUTE_CONST, + _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEPRECATED, _GL_ATTRIBUTE_ERROR, + _GL_ATTRIBUTE_WARNING, _GL_ATTRIBUTE_EXTERNALLY_VISIBLE, + _GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_LEAF, + _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED, + _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL, + _GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, + _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_RETURNS_NONNULL, + _GL_ATTRIBUTE_SENTINEL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + + /* =============== Attributes for specific kinds of functions =============== */ /* Attributes for functions that should not be used. */ diff --git a/lib/backupfile.h b/lib/backupfile.h index 81fc35cf00..73fa610225 100644 --- a/lib/backupfile.h +++ b/lib/backupfile.h @@ -19,6 +19,11 @@ #ifndef BACKUPFILE_H_ #define BACKUPFILE_H_ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get AT_FDCWD, as a convenience for users of this file. */ #include <fcntl.h> diff --git a/lib/base32.h b/lib/base32.h index 8f8d862ab1..2e784d95c8 100644 --- a/lib/base32.h +++ b/lib/base32.h @@ -18,6 +18,11 @@ #ifndef BASE32_H # define BASE32_H +/* This file uses _GL_ATTRIBUTE_CONST. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get idx_t. */ # include <idx.h> diff --git a/lib/base64.h b/lib/base64.h index 9913765200..b5cb2ea5cb 100644 --- a/lib/base64.h +++ b/lib/base64.h @@ -18,6 +18,11 @@ #ifndef BASE64_H # define BASE64_H +/* This file uses _GL_ATTRIBUTE_CONST. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get idx_t. */ # include <idx.h> diff --git a/lib/basename-lgpl.h b/lib/basename-lgpl.h index 5d996c1da5..c1982fa8eb 100644 --- a/lib/basename-lgpl.h +++ b/lib/basename-lgpl.h @@ -19,6 +19,11 @@ #ifndef _BASENAME_LGPL_H #define _BASENAME_LGPL_H +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT diff --git a/lib/binary-io.h b/lib/binary-io.h index 6f4db25335..855d6f819f 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h @@ -17,6 +17,11 @@ #ifndef _BINARY_H #define _BINARY_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_UNUSED. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* For systems that distinguish between text and binary I/O. O_BINARY is guaranteed by the gnulib <fcntl.h>. */ #include <fcntl.h> @@ -25,9 +30,6 @@ so we include it here first. */ #include <stdio.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef BINARY_IO_INLINE # define BINARY_IO_INLINE _GL_INLINE diff --git a/lib/bitrotate.h b/lib/bitrotate.h index de1ee8257c..6fb7b4957f 100644 --- a/lib/bitrotate.h +++ b/lib/bitrotate.h @@ -19,13 +19,15 @@ #ifndef _GL_BITROTATE_H #define _GL_BITROTATE_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <limits.h> #include <stdint.h> #include <sys/types.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef BITROTATE_INLINE # define BITROTATE_INLINE _GL_INLINE diff --git a/lib/bitset.h b/lib/bitset.h index fe5da8fd6a..bb6596f7fe 100644 --- a/lib/bitset.h +++ b/lib/bitset.h @@ -23,6 +23,11 @@ /* This file is the public interface to the bitset abstract data type. Only use the functions and macros defined in this file. */ +/* This file uses _GL_ATTRIBUTE_DEALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> #if USE_UNLOCKED_IO # include "unlocked-io.h" diff --git a/lib/bitsetv.h b/lib/bitsetv.h index 72f7e0bd05..96cdd1d7fb 100644 --- a/lib/bitsetv.h +++ b/lib/bitsetv.h @@ -21,6 +21,11 @@ #ifndef _BITSETV_H #define _BITSETV_H +/* This file uses _GL_ATTRIBUTE_DEALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "bitset.h" typedef bitset * bitsetv; diff --git a/lib/c-ctype.h b/lib/c-ctype.h index 35ca83d7d4..cb0f4f3ba1 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -23,9 +23,11 @@ #ifndef C_CTYPE_H #define C_CTYPE_H -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + _GL_INLINE_HEADER_BEGIN #ifndef C_CTYPE_INLINE # define C_CTYPE_INLINE _GL_INLINE diff --git a/lib/c-snprintf.h b/lib/c-snprintf.h index 3515b14f66..c973f35b8a 100644 --- a/lib/c-snprintf.h +++ b/lib/c-snprintf.h @@ -17,6 +17,11 @@ #ifndef _C_SNPRINTF_H #define _C_SNPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get size_t. */ #include <stddef.h> diff --git a/lib/c-stack.h b/lib/c-stack.h index d9556a9db2..7958112b82 100644 --- a/lib/c-stack.h +++ b/lib/c-stack.h @@ -15,6 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ASYNC_SAFE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifdef __cplusplus extern "C" { @@ -52,6 +57,6 @@ extern "C" extern int c_stack_action (_GL_ASYNC_SAFE void (* /*action*/) (int)); -# ifdef __cplusplus +#ifdef __cplusplus } -# endif +#endif diff --git a/lib/c-strcase.h b/lib/c-strcase.h index 9bcca01b27..5dfa96c41f 100644 --- a/lib/c-strcase.h +++ b/lib/c-strcase.h @@ -18,6 +18,11 @@ #ifndef C_STRCASE_H #define C_STRCASE_H +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> diff --git a/lib/c-vasnprintf.h b/lib/c-vasnprintf.h index 21464ceb1d..c2f0c0c96d 100644 --- a/lib/c-vasnprintf.h +++ b/lib/c-vasnprintf.h @@ -17,6 +17,11 @@ #ifndef _C_VASNPRINTF_H #define _C_VASNPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get va_list. */ #include <stdarg.h> diff --git a/lib/c-vasprintf.h b/lib/c-vasprintf.h index 9c4a042612..f61e78299e 100644 --- a/lib/c-vasprintf.h +++ b/lib/c-vasprintf.h @@ -17,6 +17,11 @@ #ifndef _C_VASPRINTF_H #define _C_VASPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get va_list. */ #include <stdarg.h> diff --git a/lib/c-vsnprintf.h b/lib/c-vsnprintf.h index 978f372635..3e94846d22 100644 --- a/lib/c-vsnprintf.h +++ b/lib/c-vsnprintf.h @@ -17,6 +17,11 @@ #ifndef _C_VSNPRINTF_H #define _C_VSNPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get size_t. */ #include <stddef.h> diff --git a/lib/c-xvasprintf.h b/lib/c-xvasprintf.h index 985314b738..33f87cd17c 100644 --- a/lib/c-xvasprintf.h +++ b/lib/c-xvasprintf.h @@ -17,6 +17,11 @@ #ifndef _C_XVASPRINTF_H #define _C_XVASPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get va_list. */ #include <stdarg.h> diff --git a/lib/canon-host.h b/lib/canon-host.h index c1f55c0982..91faabf7f7 100644 --- a/lib/canon-host.h +++ b/lib/canon-host.h @@ -20,6 +20,11 @@ #ifndef CANON_HOST_H # define CANON_HOST_H 1 +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <stdlib.h> char *canon_host (char const *host) diff --git a/lib/canonicalize.h b/lib/canonicalize.h index e0cfafd8fa..ea09c666f9 100644 --- a/lib/canonicalize.h +++ b/lib/canonicalize.h @@ -17,6 +17,11 @@ #ifndef CANONICALIZE_H_ # define CANONICALIZE_H_ +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> /* for canonicalize_file_name */ #define CAN_MODE_MASK (CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING) diff --git a/lib/clean-temp.h b/lib/clean-temp.h index 1e754561b3..a7cf6e74c0 100644 --- a/lib/clean-temp.h +++ b/lib/clean-temp.h @@ -18,6 +18,11 @@ #ifndef _CLEAN_TEMP_H #define _CLEAN_TEMP_H +/* This file uses _GL_ATTRIBUTE_DEALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> #include <sys/types.h> diff --git a/lib/concat-filename.h b/lib/concat-filename.h index 0912226387..490aa96fe5 100644 --- a/lib/concat-filename.h +++ b/lib/concat-filename.h @@ -17,6 +17,11 @@ #ifndef _CONCAT_FILENAME_H #define _CONCAT_FILENAME_H +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #ifdef __cplusplus diff --git a/lib/count-leading-zeros.h b/lib/count-leading-zeros.h index 99151d695b..9fe2a03ee0 100644 --- a/lib/count-leading-zeros.h +++ b/lib/count-leading-zeros.h @@ -19,12 +19,14 @@ #ifndef COUNT_LEADING_ZEROS_H #define COUNT_LEADING_ZEROS_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <limits.h> #include <stdlib.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef COUNT_LEADING_ZEROS_INLINE # define COUNT_LEADING_ZEROS_INLINE _GL_INLINE diff --git a/lib/count-one-bits.h b/lib/count-one-bits.h index 01a60b77b8..2821a1fb75 100644 --- a/lib/count-one-bits.h +++ b/lib/count-one-bits.h @@ -19,12 +19,14 @@ #ifndef COUNT_ONE_BITS_H #define COUNT_ONE_BITS_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <limits.h> #include <stdlib.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef COUNT_ONE_BITS_INLINE # define COUNT_ONE_BITS_INLINE _GL_INLINE diff --git a/lib/count-trailing-zeros.h b/lib/count-trailing-zeros.h index ef8e164126..9b33df76f6 100644 --- a/lib/count-trailing-zeros.h +++ b/lib/count-trailing-zeros.h @@ -19,12 +19,14 @@ #ifndef COUNT_TRAILING_ZEROS_H #define COUNT_TRAILING_ZEROS_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <limits.h> #include <stdlib.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef COUNT_TRAILING_ZEROS_INLINE # define COUNT_TRAILING_ZEROS_INLINE _GL_INLINE diff --git a/lib/ctype.in.h b/lib/ctype.in.h index 9ae63f911a..8f7b68aa0f 100644 --- a/lib/ctype.in.h +++ b/lib/ctype.in.h @@ -36,6 +36,11 @@ #ifndef _@GUARD_PREFIX@_CTYPE_H #define _@GUARD_PREFIX@_CTYPE_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ diff --git a/lib/dfa.h b/lib/dfa.h index 6ac30ffac3..117332694e 100644 --- a/lib/dfa.h +++ b/lib/dfa.h @@ -21,6 +21,12 @@ #ifndef DFA_H_ #define DFA_H_ +/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "idx.h" #include <regex.h> #include <stddef.h> diff --git a/lib/di-set.h b/lib/di-set.h index 10dacd584e..01e10c891f 100644 --- a/lib/di-set.h +++ b/lib/di-set.h @@ -19,6 +19,12 @@ #ifndef _GL_DI_SET_H # define _GL_DI_SET_H +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_NONNULL. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <sys/types.h> struct di_set; diff --git a/lib/dirent-safer.h b/lib/dirent-safer.h index e7d00c5771..d9dad70ed0 100644 --- a/lib/dirent-safer.h +++ b/lib/dirent-safer.h @@ -17,6 +17,11 @@ /* Written by Eric Blake. */ +/* This file uses _GL_ATTRIBUTE_DEALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <dirent.h> #ifdef __cplusplus diff --git a/lib/dirent.in.h b/lib/dirent.in.h index 2aaabd054a..e4e65bdeb8 100644 --- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -29,6 +29,12 @@ #ifndef _@GUARD_PREFIX@_DIRENT_H #define _@GUARD_PREFIX@_DIRENT_H +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get ino_t. Needed on some systems, including glibc 2.8. */ #include <sys/types.h> diff --git a/lib/dirname.h b/lib/dirname.h index f98e83bd4c..0344f1c44c 100644 --- a/lib/dirname.h +++ b/lib/dirname.h @@ -19,6 +19,12 @@ #ifndef DIRNAME_H_ # define DIRNAME_H_ 1 +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_PURE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + # include <stdlib.h> # include "filename.h" # include "basename-lgpl.h" diff --git a/lib/eealloc.h b/lib/eealloc.h index 6a897072d7..6666f172c6 100644 --- a/lib/eealloc.h +++ b/lib/eealloc.h @@ -29,11 +29,14 @@ and realloc() this way; on such platforms the workalikes are aliased to the original malloc()/realloc() functions. */ -#include <stdlib.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_ALLOC_SIZE, + _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <stdlib.h> + _GL_INLINE_HEADER_BEGIN #ifndef EEALLOC_INLINE # define EEALLOC_INLINE _GL_INLINE diff --git a/lib/eloop-threshold.h b/lib/eloop-threshold.h index 510f261795..d9b154e486 100644 --- a/lib/eloop-threshold.h +++ b/lib/eloop-threshold.h @@ -19,6 +19,11 @@ #ifndef _ELOOP_THRESHOLD_H #define _ELOOP_THRESHOLD_H 1 +/* This file uses _GL_ATTRIBUTE_CONST. */ +#if !_LIBC && !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <limits.h> #ifdef _LIBC # include <sys/param.h> diff --git a/lib/error.in.h b/lib/error.in.h index dcb49d1608..9a520f1ee3 100644 --- a/lib/error.in.h +++ b/lib/error.in.h @@ -30,6 +30,11 @@ #ifndef _@GUARD_PREFIX@_ERROR_H #define _@GUARD_PREFIX@_ERROR_H +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */ #include <stdio.h> diff --git a/lib/exclude.h b/lib/exclude.h index a16b8171b6..c91e04316a 100644 --- a/lib/exclude.h +++ b/lib/exclude.h @@ -19,6 +19,12 @@ #ifndef _GL_EXCLUDE_H #define _GL_EXCLUDE_H 1 +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> /* Written by Paul Eggert <egg...@twinsun.com> diff --git a/lib/execinfo.in.h b/lib/execinfo.in.h index ff9293b632..56b04d1d86 100644 --- a/lib/execinfo.in.h +++ b/lib/execinfo.in.h @@ -20,9 +20,11 @@ #ifndef _GL_EXECINFO_H #define _GL_EXECINFO_H -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + _GL_INLINE_HEADER_BEGIN #ifndef _GL_EXECINFO_INLINE # define _GL_EXECINFO_INLINE _GL_INLINE diff --git a/lib/fatal-signal.h b/lib/fatal-signal.h index 7baae2e15b..fed4f4bb66 100644 --- a/lib/fatal-signal.h +++ b/lib/fatal-signal.h @@ -19,6 +19,11 @@ #ifndef _FATAL_SIGNAL_H #define _FATAL_SIGNAL_H +/* This file uses _GL_ASYNC_SAFE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <signal.h> #ifdef __cplusplus diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index e034eaf9f5..595e348223 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -74,6 +74,11 @@ #ifndef _@GUARD_PREFIX@_FCNTL_H #define _@GUARD_PREFIX@_FCNTL_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ # include <unistd.h> #endif diff --git a/lib/file-type.h b/lib/file-type.h index 3301729e5a..2c5a8e9afd 100644 --- a/lib/file-type.h +++ b/lib/file-type.h @@ -21,6 +21,11 @@ #ifndef FILE_TYPE_H # define FILE_TYPE_H 1 +/* This file uses _GL_ATTRIBUTE_PURE. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <sys/types.h> # include <sys/stat.h> diff --git a/lib/filenamecat.h b/lib/filenamecat.h index ab867f9c81..29a4daafd4 100644 --- a/lib/filenamecat.h +++ b/lib/filenamecat.h @@ -18,6 +18,11 @@ /* Written by Jim Meyering. */ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #if GNULIB_FILENAMECAT diff --git a/lib/filevercmp.h b/lib/filevercmp.h index 6b81ab32a7..9e052bdd08 100644 --- a/lib/filevercmp.h +++ b/lib/filevercmp.h @@ -20,6 +20,11 @@ #ifndef FILEVERCMP_H #define FILEVERCMP_H +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> /* Compare strings A and B as file names containing version numbers, diff --git a/lib/flexmember.h b/lib/flexmember.h index a6cc876a6d..8c5915ecf9 100644 --- a/lib/flexmember.h +++ b/lib/flexmember.h @@ -20,6 +20,11 @@ Written by Paul Eggert. */ +/* This file uses _Alignof. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> /* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below. diff --git a/lib/fnmatch.in.h b/lib/fnmatch.in.h index e8d19e2751..2502c61aa2 100644 --- a/lib/fnmatch.in.h +++ b/lib/fnmatch.in.h @@ -32,6 +32,11 @@ #ifndef _@GUARD_PREFIX@_FNMATCH_H #define _@GUARD_PREFIX@_FNMATCH_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ diff --git a/lib/fpending.h b/lib/fpending.h index 5e860db681..0585dcb329 100644 --- a/lib/fpending.h +++ b/lib/fpending.h @@ -18,6 +18,11 @@ Written by Jim Meyering. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #include <stdio.h> #if HAVE_STDIO_EXT_H diff --git a/lib/freadable.h b/lib/freadable.h index 1a676b106f..c5d5d5cfb9 100644 --- a/lib/freadable.h +++ b/lib/freadable.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> /* Return true if the stream STREAM supports reading, false if it supports diff --git a/lib/freadahead.h b/lib/freadahead.h index 91c74d525c..d47026a05a 100644 --- a/lib/freadahead.h +++ b/lib/freadahead.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #include <stdio.h> diff --git a/lib/freading.h b/lib/freading.h index 27b3abbc76..c18ea4a292 100644 --- a/lib/freading.h +++ b/lib/freading.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> /* Return true if the stream STREAM is opened read-only, or if the diff --git a/lib/fts_.h b/lib/fts_.h index 6de50bf692..fa3d4146e2 100644 --- a/lib/fts_.h +++ b/lib/fts_.h @@ -49,6 +49,11 @@ #ifndef _FTS_H # define _FTS_H 1 +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_NODISCARD. */ +# if !_LIBC && !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # ifdef _LIBC # include <features.h> # if __STDC_VERSION__ < 199901L diff --git a/lib/fwritable.h b/lib/fwritable.h index f87b112194..d3c0b46615 100644 --- a/lib/fwritable.h +++ b/lib/fwritable.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> /* Return true if the stream STREAM supports writing, false if it supports diff --git a/lib/fwriting.h b/lib/fwriting.h index 91e060081f..28cb2c878a 100644 --- a/lib/fwriting.h +++ b/lib/fwriting.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> /* Return true if the stream STREAM is opened write-only or diff --git a/lib/gc.h b/lib/gc.h index 1b94e36693..69a251f550 100644 --- a/lib/gc.h +++ b/lib/gc.h @@ -19,6 +19,11 @@ #ifndef _GL_GC_H # define _GL_GC_H +/* This file uses _GL_ATTRIBUTE_CONST. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + /* Get size_t. */ # include <stddef.h> diff --git a/lib/get_progname_of.h b/lib/get_progname_of.h index 58b21accdb..a6b75195f8 100644 --- a/lib/get_progname_of.h +++ b/lib/get_progname_of.h @@ -18,6 +18,11 @@ #ifndef _GET_PROGNAME_OF_H #define _GET_PROGNAME_OF_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #include <sys/types.h> diff --git a/lib/gethrxtime.h b/lib/gethrxtime.h index 4a6847b725..3a1340b69d 100644 --- a/lib/gethrxtime.h +++ b/lib/gethrxtime.h @@ -20,11 +20,13 @@ #ifndef GETHRXTIME_H_ #define GETHRXTIME_H_ 1 -#include "xtime.h" - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include "xtime.h" + _GL_INLINE_HEADER_BEGIN #ifndef GETHRXTIME_INLINE # define GETHRXTIME_INLINE _GL_INLINE diff --git a/lib/gl_list.h b/lib/gl_list.h index 9bb3d38206..b550db0672 100644 --- a/lib/gl_list.h +++ b/lib/gl_list.h @@ -18,11 +18,14 @@ #ifndef _GL_LIST_H #define _GL_LIST_H -#include <stddef.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <stddef.h> + _GL_INLINE_HEADER_BEGIN #ifndef GL_LIST_INLINE # define GL_LIST_INLINE _GL_INLINE diff --git a/lib/gl_map.h b/lib/gl_map.h index f646ce8f51..12846f44d1 100644 --- a/lib/gl_map.h +++ b/lib/gl_map.h @@ -18,11 +18,14 @@ #ifndef _GL_MAP_H #define _GL_MAP_H -#include <stddef.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <stddef.h> + _GL_INLINE_HEADER_BEGIN #ifndef GL_MAP_INLINE # define GL_MAP_INLINE _GL_INLINE diff --git a/lib/gl_omap.h b/lib/gl_omap.h index 180c5df448..124c6d0852 100644 --- a/lib/gl_omap.h +++ b/lib/gl_omap.h @@ -18,11 +18,14 @@ #ifndef _GL_OMAP_H #define _GL_OMAP_H -#include <stddef.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <stddef.h> + _GL_INLINE_HEADER_BEGIN #ifndef GL_OMAP_INLINE # define GL_OMAP_INLINE _GL_INLINE diff --git a/lib/gl_openssl.h b/lib/gl_openssl.h index f63c386ecb..159a837f1a 100644 --- a/lib/gl_openssl.h +++ b/lib/gl_openssl.h @@ -17,13 +17,15 @@ /* Written by Pádraig Brady */ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifndef GL_OPENSSL_NAME # error "Please define GL_OPENSSL_NAME to 1,5,256 etc." #endif -#ifndef _GL_INLINE_HEADER_BEGIN -# error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_OPENSSL_INLINE # define GL_OPENSSL_INLINE _GL_INLINE diff --git a/lib/gl_oset.h b/lib/gl_oset.h index 890056484a..d5f20297b8 100644 --- a/lib/gl_oset.h +++ b/lib/gl_oset.h @@ -18,11 +18,14 @@ #ifndef _GL_OSET_H #define _GL_OSET_H -#include <stddef.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <stddef.h> + _GL_INLINE_HEADER_BEGIN #ifndef GL_OSET_INLINE # define GL_OSET_INLINE _GL_INLINE diff --git a/lib/gl_set.h b/lib/gl_set.h index b600ad572e..e88e2552bd 100644 --- a/lib/gl_set.h +++ b/lib/gl_set.h @@ -18,11 +18,14 @@ #ifndef _GL_SET_H #define _GL_SET_H -#include <stddef.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <stddef.h> + _GL_INLINE_HEADER_BEGIN #ifndef GL_SET_INLINE # define GL_SET_INLINE _GL_INLINE diff --git a/lib/gl_xlist.h b/lib/gl_xlist.h index f5fd929bbe..91ed804b9d 100644 --- a/lib/gl_xlist.h +++ b/lib/gl_xlist.h @@ -18,12 +18,15 @@ #ifndef _GL_XLIST_H #define _GL_XLIST_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "gl_list.h" #include "xalloc.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_XLIST_INLINE # define GL_XLIST_INLINE _GL_INLINE diff --git a/lib/gl_xmap.h b/lib/gl_xmap.h index cfb2b9c3b9..ad1edbfb76 100644 --- a/lib/gl_xmap.h +++ b/lib/gl_xmap.h @@ -18,12 +18,15 @@ #ifndef _GL_XMAP_H #define _GL_XMAP_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "gl_map.h" #include "xalloc.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_XMAP_INLINE # define GL_XMAP_INLINE _GL_INLINE diff --git a/lib/gl_xomap.h b/lib/gl_xomap.h index 4b7da8d019..e9115627d2 100644 --- a/lib/gl_xomap.h +++ b/lib/gl_xomap.h @@ -18,12 +18,15 @@ #ifndef _GL_XOMAP_H #define _GL_XOMAP_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "gl_omap.h" #include "xalloc.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_XOMAP_INLINE # define GL_XOMAP_INLINE _GL_INLINE diff --git a/lib/gl_xoset.h b/lib/gl_xoset.h index f58930985c..5ebb209b2d 100644 --- a/lib/gl_xoset.h +++ b/lib/gl_xoset.h @@ -18,12 +18,15 @@ #ifndef _GL_XOSET_H #define _GL_XOSET_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "gl_oset.h" #include "xalloc.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_XOSET_INLINE # define GL_XOSET_INLINE _GL_INLINE diff --git a/lib/gl_xset.h b/lib/gl_xset.h index 769bca8210..921e1f38f4 100644 --- a/lib/gl_xset.h +++ b/lib/gl_xset.h @@ -18,12 +18,15 @@ #ifndef _GL_XSET_H #define _GL_XSET_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "gl_set.h" #include "xalloc.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_XSET_INLINE # define GL_XSET_INLINE _GL_INLINE diff --git a/lib/gl_xsublist.h b/lib/gl_xsublist.h index 47db4ab277..5d92e6c3e5 100644 --- a/lib/gl_xsublist.h +++ b/lib/gl_xsublist.h @@ -19,12 +19,15 @@ #ifndef _GL_XSUBLIST_H #define _GL_XSUBLIST_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "gl_sublist.h" #include "xalloc.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_XSUBLIST_INLINE # define GL_XSUBLIST_INLINE _GL_INLINE diff --git a/lib/glob.in.h b/lib/glob.in.h index 7fc3ef7347..1f0481d524 100644 --- a/lib/glob.in.h +++ b/lib/glob.in.h @@ -32,6 +32,11 @@ #ifndef _@GUARD_PREFIX@_GLOB_H #define _@GUARD_PREFIX@_GLOB_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ diff --git a/lib/glthread/cond.h b/lib/glthread/cond.h index 5e6f681cac..4c780d2def 100644 --- a/lib/glthread/cond.h +++ b/lib/glthread/cond.h @@ -48,6 +48,11 @@ #ifndef _GLTHREAD_COND_H #define _GLTHREAD_COND_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <errno.h> #include <stdlib.h> #include <time.h> @@ -66,10 +71,6 @@ # endif #endif -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif - _GL_INLINE_HEADER_BEGIN #ifndef _GLTHREAD_COND_INLINE # define _GLTHREAD_COND_INLINE _GL_INLINE diff --git a/lib/glthread/thread.h b/lib/glthread/thread.h index 788dc5fe68..091b601e99 100644 --- a/lib/glthread/thread.h +++ b/lib/glthread/thread.h @@ -70,6 +70,11 @@ #ifndef _GLTHREAD_THREAD_H #define _GLTHREAD_THREAD_H +/* This file uses _Noreturn. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <errno.h> #include <stdlib.h> diff --git a/lib/hamt.h b/lib/hamt.h index 36142418d3..bd025d4cb4 100644 --- a/lib/hamt.h +++ b/lib/hamt.h @@ -45,9 +45,12 @@ #ifndef _GL_HAMT_H #define _GL_HAMT_H -#ifndef _GL_INLINE_HEADER_BEGIN -# error "Please include config.h first." +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_DEALLOC, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." #endif + _GL_INLINE_HEADER_BEGIN #ifndef _GL_HAMT_INLINE # define _GL_HAMT_INLINE _GL_INLINE diff --git a/lib/hash-pjw-bare.h b/lib/hash-pjw-bare.h index fb847946fb..7498ca20b4 100644 --- a/lib/hash-pjw-bare.h +++ b/lib/hash-pjw-bare.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> /* Compute a hash code for a buffer starting at X and of size N, diff --git a/lib/hash-pjw.h b/lib/hash-pjw.h index 5e046c54d4..69af02f2c4 100644 --- a/lib/hash-pjw.h +++ b/lib/hash-pjw.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> /* Compute a hash code for a NUL-terminated string starting at X, diff --git a/lib/hash-triple.h b/lib/hash-triple.h index 64d437285d..f2cf38b1db 100644 --- a/lib/hash-triple.h +++ b/lib/hash-triple.h @@ -19,6 +19,11 @@ #ifndef HASH_TRIPLE_H #define HASH_TRIPLE_H +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <sys/types.h> #include <sys/stat.h> diff --git a/lib/hash.h b/lib/hash.h index fe88b4dda8..be42e5af6a 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -24,6 +24,13 @@ #ifndef HASH_H_ # define HASH_H_ +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEPRECATED, + _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_PURE, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + # include <stdio.h> # ifdef __cplusplus diff --git a/lib/i-ring.h b/lib/i-ring.h index a2e0c7a571..e10b5d980b 100644 --- a/lib/i-ring.h +++ b/lib/i-ring.h @@ -15,6 +15,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + enum { I_RING_SIZE = 4 }; static_assert (1 <= I_RING_SIZE); diff --git a/lib/ialloc.h b/lib/ialloc.h index 275237ccb1..8d49887b6a 100644 --- a/lib/ialloc.h +++ b/lib/ialloc.h @@ -18,15 +18,18 @@ #ifndef IALLOC_H_ #define IALLOC_H_ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_COLD, + _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "idx.h" #include <errno.h> #include <stdint.h> #include <stdlib.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef IALLOC_INLINE # define IALLOC_INLINE _GL_INLINE diff --git a/lib/iconv.in.h b/lib/iconv.in.h index 09943a72cb..49390e98ca 100644 --- a/lib/iconv.in.h +++ b/lib/iconv.in.h @@ -28,6 +28,11 @@ #ifndef _@GUARD_PREFIX@_ICONV_H #define _@GUARD_PREFIX@_ICONV_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ diff --git a/lib/ino-map.h b/lib/ino-map.h index 06a664b3ed..a71d7bcfbb 100644 --- a/lib/ino-map.h +++ b/lib/ino-map.h @@ -19,6 +19,12 @@ #ifndef _GL_INO_MAP_H # define _GL_INO_MAP_H +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_NONNULL. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <sys/types.h> # define INO_MAP_INSERT_FAILURE ((size_t) -1) diff --git a/lib/inttostr.h b/lib/inttostr.h index 6fbe2312bf..7e653f2d1f 100644 --- a/lib/inttostr.h +++ b/lib/inttostr.h @@ -17,6 +17,11 @@ /* Written by Paul Eggert */ +/* This file uses _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdint.h> #include <sys/types.h> diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index 5b7ef12dc7..aa8258d33c 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -46,6 +46,11 @@ #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H #define INTTYPES_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Include <stdint.h> or the gnulib replacement. But avoid namespace pollution on glibc systems. */ #ifndef __GLIBC__ diff --git a/lib/javaversion.h b/lib/javaversion.h index 1e89291e7d..99157466b9 100644 --- a/lib/javaversion.h +++ b/lib/javaversion.h @@ -18,6 +18,11 @@ #ifndef _JAVAVERSION_H #define _JAVAVERSION_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> diff --git a/lib/langinfo.in.h b/lib/langinfo.in.h index 82e1e3cb1b..057cf15695 100644 --- a/lib/langinfo.in.h +++ b/lib/langinfo.in.h @@ -34,6 +34,11 @@ #ifndef _@GUARD_PREFIX@_LANGINFO_H #define _@GUARD_PREFIX@_LANGINFO_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if !@HAVE_LANGINFO_H@ diff --git a/lib/locale.in.h b/lib/locale.in.h index e37702c4eb..917a43b02d 100644 --- a/lib/locale.in.h +++ b/lib/locale.in.h @@ -44,6 +44,11 @@ #ifndef _@GUARD_PREFIX@_LOCALE_H #define _@GUARD_PREFIX@_LOCALE_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* NetBSD 5.0 mis-defines NULL. */ #include <stddef.h> diff --git a/lib/localename.h b/lib/localename.h index bfb429cb4d..f5663a6b37 100644 --- a/lib/localename.h +++ b/lib/localename.h @@ -17,6 +17,11 @@ #ifndef _GL_LOCALENAME_H #define _GL_LOCALENAME_H +/* This file uses _GL_ATTRIBUTE_CONST. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/lib/malloc.in.h b/lib/malloc.in.h index 2fcbe23535..3da05c2057 100644 --- a/lib/malloc.in.h +++ b/lib/malloc.in.h @@ -46,6 +46,11 @@ #ifndef _@GUARD_PREFIX@_MALLOC_H #define _@GUARD_PREFIX@_MALLOC_H +/* This file uses _GL_ATTRIBUTE_DEALLOC, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Solaris declares memalign() in <stdlib.h>, not in <malloc.h>. */ #if defined __sun || defined __hpux # include <stdlib.h> diff --git a/lib/malloca.h b/lib/malloca.h index 325c727717..576a56de40 100644 --- a/lib/malloca.h +++ b/lib/malloca.h @@ -18,6 +18,12 @@ #ifndef _MALLOCA_H #define _MALLOCA_H +/* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_DEALLOC, + _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <alloca.h> #include <stddef.h> #include <stdlib.h> diff --git a/lib/math.in.h b/lib/math.in.h index 76d48a4443..9d0e6918aa 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -48,14 +48,17 @@ #ifndef _@GUARD_PREFIX@_MATH_H #define _@GUARD_PREFIX@_MATH_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_CONST, + GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* On OpenVMS, NAN, INFINITY, and HUGEVAL macros are defined in <fp.h>. */ #if defined __VMS && ! defined NAN # include <fp.h> #endif -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_MATH_INLINE # define _GL_MATH_INLINE _GL_INLINE diff --git a/lib/mbchar.h b/lib/mbchar.h index 65050c023b..a2ff1d8b21 100644 --- a/lib/mbchar.h +++ b/lib/mbchar.h @@ -144,13 +144,15 @@ #ifndef _MBCHAR_H #define _MBCHAR_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <string.h> #include <wchar.h> #include <wctype.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef MBCHAR_INLINE # define MBCHAR_INLINE _GL_INLINE diff --git a/lib/mbfile.h b/lib/mbfile.h index faf95f4be7..3482f394b9 100644 --- a/lib/mbfile.h +++ b/lib/mbfile.h @@ -47,6 +47,11 @@ #ifndef _MBFILE_H #define _MBFILE_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <assert.h> #include <stdio.h> #include <string.h> @@ -54,9 +59,6 @@ #include "mbchar.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef MBFILE_INLINE # define MBFILE_INLINE _GL_INLINE diff --git a/lib/mbiter.h b/lib/mbiter.h index ce901932f1..7b41870b55 100644 --- a/lib/mbiter.h +++ b/lib/mbiter.h @@ -82,6 +82,11 @@ #ifndef _MBITER_H #define _MBITER_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <assert.h> #include <stddef.h> #include <string.h> @@ -89,9 +94,6 @@ #include "mbchar.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef MBITER_INLINE # define MBITER_INLINE _GL_INLINE diff --git a/lib/mbuiter.h b/lib/mbuiter.h index fc1b9dbb32..7a619f19e1 100644 --- a/lib/mbuiter.h +++ b/lib/mbuiter.h @@ -89,6 +89,11 @@ #ifndef _MBUITER_H #define _MBUITER_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <assert.h> #include <stddef.h> #include <stdlib.h> @@ -98,9 +103,6 @@ #include "mbchar.h" #include "strnlen1.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef MBUITER_INLINE # define MBUITER_INLINE _GL_INLINE diff --git a/lib/memcasecmp.h b/lib/memcasecmp.h index d8732401df..e5101aff03 100644 --- a/lib/memcasecmp.h +++ b/lib/memcasecmp.h @@ -17,6 +17,11 @@ /* Written by Jim Meyering. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> int memcasecmp (const void *vs1, const void *vs2, size_t n) _GL_ATTRIBUTE_PURE; diff --git a/lib/memchr2.h b/lib/memchr2.h index 51d8e7bbcf..6554a676b4 100644 --- a/lib/memchr2.h +++ b/lib/memchr2.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #ifdef __cplusplus diff --git a/lib/memcmp2.h b/lib/memcmp2.h index abcf3e7650..0878a73e73 100644 --- a/lib/memcmp2.h +++ b/lib/memcmp2.h @@ -17,6 +17,11 @@ #ifndef MEMCMP2_H #define MEMCMP2_H +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #ifdef __cplusplus diff --git a/lib/modechange.h b/lib/modechange.h index cd613c8555..b4fc36a563 100644 --- a/lib/modechange.h +++ b/lib/modechange.h @@ -19,6 +19,11 @@ #if ! defined MODECHANGE_H_ # define MODECHANGE_H_ +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <stdlib.h> # include <sys/types.h> diff --git a/lib/monetary.in.h b/lib/monetary.in.h index 255958d2d8..45a92802b5 100644 --- a/lib/monetary.in.h +++ b/lib/monetary.in.h @@ -29,6 +29,11 @@ #ifndef _@GUARD_PREFIX@_MONETARY_H #define _@GUARD_PREFIX@_MONETARY_H +/* This file uses _GL_ATTRIBUTE_FORMAT, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if @GNULIB_STRFMON_L@ # if @HAVE_XLOCALE_H@ /* Get locale_t on Mac OS X 10.12. */ diff --git a/lib/mountlist.h b/lib/mountlist.h index aed7f8877f..d33f13a036 100644 --- a/lib/mountlist.h +++ b/lib/mountlist.h @@ -19,6 +19,11 @@ #ifndef MOUNTLIST_H_ # define MOUNTLIST_H_ +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <sys/types.h> /* A mount table entry. */ diff --git a/lib/netdb.in.h b/lib/netdb.in.h index 9549cd7326..ea5ff40c60 100644 --- a/lib/netdb.in.h +++ b/lib/netdb.in.h @@ -36,6 +36,11 @@ #ifndef _@GUARD_PREFIX@_NETDB_H #define _@GUARD_PREFIX@_NETDB_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get <netdb.h> definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and 'struct hostent' on MinGW. */ #include <sys/socket.h> diff --git a/lib/obstack.h b/lib/obstack.h index 1e66e4d4c8..cb080c33b5 100644 --- a/lib/obstack.h +++ b/lib/obstack.h @@ -103,6 +103,11 @@ #ifndef _OBSTACK_H #define _OBSTACK_H 1 +/* This file uses _Noreturn, _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifndef _OBSTACK_INTERFACE_VERSION # define _OBSTACK_INTERFACE_VERSION 2 #endif diff --git a/lib/openat.h b/lib/openat.h index 37d8eedbee..ba4a780dc0 100644 --- a/lib/openat.h +++ b/lib/openat.h @@ -19,15 +19,18 @@ #ifndef _GL_HEADER_OPENAT #define _GL_HEADER_OPENAT +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _Noreturn, + _GL_ATTRIBUTE_DEPRECATED. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #if !HAVE_OPENAT diff --git a/lib/opendirat.h b/lib/opendirat.h index 9e445cd29a..5934e89bcd 100644 --- a/lib/opendirat.h +++ b/lib/opendirat.h @@ -15,6 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <dirent.h> DIR *opendirat (int, char const *, int, int *) diff --git a/lib/pagealign_alloc.h b/lib/pagealign_alloc.h index 8f2083c446..e8ed6551c5 100644 --- a/lib/pagealign_alloc.h +++ b/lib/pagealign_alloc.h @@ -18,6 +18,13 @@ #ifndef _PAGEALIGN_ALLOC_H # define _PAGEALIGN_ALLOC_H +/* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_DEALLOC, + _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NONNULL, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <stddef.h> /* Free a memory block. diff --git a/lib/pipe-filter-aux.h b/lib/pipe-filter-aux.h index 6294d0df85..4d60ddace9 100644 --- a/lib/pipe-filter-aux.h +++ b/lib/pipe-filter-aux.h @@ -15,9 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + _GL_INLINE_HEADER_BEGIN #ifndef PIPE_FILTER_AUX_INLINE # define PIPE_FILTER_AUX_INLINE _GL_INLINE diff --git a/lib/pipe-filter.h b/lib/pipe-filter.h index d93ba9d84d..219f07c901 100644 --- a/lib/pipe-filter.h +++ b/lib/pipe-filter.h @@ -19,6 +19,11 @@ #ifndef _PIPE_FILTER_H #define _PIPE_FILTER_H +/* This file uses _GL_ATTRIBUTE_DEALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #ifdef __cplusplus diff --git a/lib/poll.in.h b/lib/poll.in.h index 9a15ef6732..5ae097fa60 100644 --- a/lib/poll.in.h +++ b/lib/poll.in.h @@ -33,6 +33,11 @@ #ifndef _@GUARD_PREFIX@_POLL_H #define _@GUARD_PREFIX@_POLL_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* On native Windows, get the 'struct pollfd' type and the POLL* macro definitions before we override them. mingw defines them in <winsock2.h> if _WIN32_WINNT >= 0x0600. */ diff --git a/lib/priv-set.h b/lib/priv-set.h index 78af45038f..e9ffc0c9aa 100644 --- a/lib/priv-set.h +++ b/lib/priv-set.h @@ -17,9 +17,11 @@ Written by David Bartley. */ -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + _GL_INLINE_HEADER_BEGIN #ifndef PRIV_SET_INLINE # define PRIV_SET_INLINE _GL_INLINE diff --git a/lib/pthread.in.h b/lib/pthread.in.h index 4f206681a9..ff6ad34a32 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -51,6 +51,11 @@ #ifndef _@GUARD_PREFIX@_PTHREAD_H_ #define _@GUARD_PREFIX@_PTHREAD_H_ +/* This file uses _Noreturn, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #define __need_system_stdlib_h #include <stdlib.h> #undef __need_system_stdlib_h diff --git a/lib/pty.in.h b/lib/pty.in.h index 8f7b81071a..f746234428 100644 --- a/lib/pty.in.h +++ b/lib/pty.in.h @@ -29,6 +29,11 @@ #ifndef _@GUARD_PREFIX@_PTY_H #define _@GUARD_PREFIX@_PTY_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Some platforms declare this in a different header than glibc. */ #if @HAVE_UTIL_H@ # include <util.h> diff --git a/lib/quotearg.h b/lib/quotearg.h index eb156126cb..baab58668f 100644 --- a/lib/quotearg.h +++ b/lib/quotearg.h @@ -21,6 +21,11 @@ #ifndef QUOTEARG_H_ # define QUOTEARG_H_ 1 +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <stdlib.h> /* Basic quoting styles. For each style, an example is given on the diff --git a/lib/read-file.h b/lib/read-file.h index 4122954e9b..5a241369c5 100644 --- a/lib/read-file.h +++ b/lib/read-file.h @@ -18,6 +18,11 @@ #ifndef READ_FILE_H #define READ_FILE_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get size_t, free(). */ #include <stdlib.h> diff --git a/lib/readline.h b/lib/readline.h index 3840d0fc2a..9048b727d7 100644 --- a/lib/readline.h +++ b/lib/readline.h @@ -18,6 +18,11 @@ #ifndef GL_READLINE_H #define GL_READLINE_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if HAVE_READLINE_READLINE_H /* <readline/readline.h> makes use of the FILE type without including <stdio.h> itself. */ diff --git a/lib/readutmp.h b/lib/readutmp.h index bf2437e02a..eda80a44fa 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -20,6 +20,11 @@ #ifndef __READUTMP_H__ # define __READUTMP_H__ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <stdlib.h> # include <sys/types.h> diff --git a/lib/regex-quote.h b/lib/regex-quote.h index cc704b2bbc..db8c249e50 100644 --- a/lib/regex-quote.h +++ b/lib/regex-quote.h @@ -18,6 +18,11 @@ #ifndef _REGEX_QUOTE_H #define _REGEX_QUOTE_H +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> /* Specifies a quotation task for converting a fixed string to a regular diff --git a/lib/relocatable.h b/lib/relocatable.h index ce8238a906..b29c29ed1b 100644 --- a/lib/relocatable.h +++ b/lib/relocatable.h @@ -18,6 +18,11 @@ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #ifdef __cplusplus diff --git a/lib/safe-alloc.h b/lib/safe-alloc.h index 6896e88147..46079d5c69 100644 --- a/lib/safe-alloc.h +++ b/lib/safe-alloc.h @@ -20,11 +20,14 @@ #ifndef SAFE_ALLOC_H_ #define SAFE_ALLOC_H_ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef SAFE_ALLOC_INLINE # define SAFE_ALLOC_INLINE _GL_INLINE diff --git a/lib/savedir.h b/lib/savedir.h index 0cc7c4eeaf..a1244ccbe4 100644 --- a/lib/savedir.h +++ b/lib/savedir.h @@ -21,6 +21,11 @@ #ifndef _GL_SAVEDIR_H #define _GL_SAVEDIR_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <dirent.h> #include <stdlib.h> diff --git a/lib/savewd.h b/lib/savewd.h index 4f69c04a05..3727f6a47b 100644 --- a/lib/savewd.h +++ b/lib/savewd.h @@ -18,13 +18,15 @@ /* Written by Paul Eggert. */ #ifndef SAVEWD_H -# define SAVEWD_H 1 +#define SAVEWD_H 1 -#include <sys/types.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <sys/types.h> + _GL_INLINE_HEADER_BEGIN #ifndef SAVEWD_INLINE # define SAVEWD_INLINE _GL_INLINE diff --git a/lib/sched.in.h b/lib/sched.in.h index 2e035b5548..fb314b86a3 100644 --- a/lib/sched.in.h +++ b/lib/sched.in.h @@ -32,6 +32,11 @@ #ifndef _@GUARD_PREFIX@_SCHED_H #define _@GUARD_PREFIX@_SCHED_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get pid_t. This is needed on glibc 2.11 (see glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=13198>) diff --git a/lib/se-context.in.h b/lib/se-context.in.h index 28515fb522..3847358e7e 100644 --- a/lib/se-context.in.h +++ b/lib/se-context.in.h @@ -17,13 +17,16 @@ /* Written by Jim Meyering, 2007. */ #ifndef SELINUX_CONTEXT_H -# define SELINUX_CONTEXT_H +#define SELINUX_CONTEXT_H -# include <errno.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_MAYBE_UNUSED. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <errno.h> + _GL_INLINE_HEADER_BEGIN #ifndef SE_CONTEXT_INLINE # define SE_CONTEXT_INLINE _GL_INLINE diff --git a/lib/se-label.in.h b/lib/se-label.in.h index 2e2a6ce8eb..6455808679 100644 --- a/lib/se-label.in.h +++ b/lib/se-label.in.h @@ -17,15 +17,17 @@ /* Written by Paul Eggert. */ #ifndef SELINUX_LABEL_H - #define SELINUX_LABEL_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_MAYBE_UNUSED. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <selinux/selinux.h> #include <errno.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef SE_LABEL_INLINE # define SE_LABEL_INLINE _GL_INLINE diff --git a/lib/se-selinux.in.h b/lib/se-selinux.in.h index edf273be1f..5ec13dde73 100644 --- a/lib/se-selinux.in.h +++ b/lib/se-selinux.in.h @@ -27,12 +27,15 @@ # if !defined _@GUARD_PREFIX@_SELINUX_SELINUX_H # define _@GUARD_PREFIX@_SELINUX_SELINUX_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_MAYBE_UNUSED. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <sys/types.h> # include <errno.h> -# ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -# endif _GL_INLINE_HEADER_BEGIN # ifndef SE_SELINUX_INLINE # define SE_SELINUX_INLINE _GL_INLINE diff --git a/lib/search.in.h b/lib/search.in.h index 32b022edc6..c0f5f0a856 100644 --- a/lib/search.in.h +++ b/lib/search.in.h @@ -30,6 +30,11 @@ #ifndef _@GUARD_PREFIX@_SEARCH_H #define _@GUARD_PREFIX@_SEARCH_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ diff --git a/lib/sh-quote.h b/lib/sh-quote.h index df8e6af6d1..8c377c442c 100644 --- a/lib/sh-quote.h +++ b/lib/sh-quote.h @@ -22,6 +22,11 @@ arguments, since Unix shells interpret characters like " ", "'", "<", ">", "$", '*', '?' etc. in a special way. */ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #ifdef __cplusplus diff --git a/lib/sig-handler.h b/lib/sig-handler.h index 3ead5fabe6..e85d30b3d3 100644 --- a/lib/sig-handler.h +++ b/lib/sig-handler.h @@ -18,11 +18,13 @@ #ifndef _GL_SIG_HANDLER_H #define _GL_SIG_HANDLER_H -#include <signal.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <signal.h> + _GL_INLINE_HEADER_BEGIN #ifndef SIG_HANDLER_INLINE # define SIG_HANDLER_INLINE _GL_INLINE diff --git a/lib/signal.in.h b/lib/signal.in.h index fea12e6572..a7006a2c49 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -55,6 +55,11 @@ #ifndef _@GUARD_PREFIX@_SIGNAL_H #define _@GUARD_PREFIX@_SIGNAL_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* For testing the OpenBSD version. */ #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \ && defined __OpenBSD__ diff --git a/lib/sigpipe-die.h b/lib/sigpipe-die.h index 1917d8cff0..f90edf105f 100644 --- a/lib/sigpipe-die.h +++ b/lib/sigpipe-die.h @@ -41,6 +41,11 @@ #ifndef _SIGPIPE_DIE_H #define _SIGPIPE_DIE_H +/* This file uses _Noreturn. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/lib/sockets.h b/lib/sockets.h index a0b1601d6b..55d5e3a4b5 100644 --- a/lib/sockets.h +++ b/lib/sockets.h @@ -20,6 +20,11 @@ #ifndef SOCKETS_H #define SOCKETS_H 1 +/* This file uses _GL_ATTRIBUTE_CONST. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #define SOCKETS_1_0 0x0001 #define SOCKETS_1_1 0x0101 #define SOCKETS_2_0 0x0002 diff --git a/lib/spawn.in.h b/lib/spawn.in.h index b35e5d77b3..169dd0bf96 100644 --- a/lib/spawn.in.h +++ b/lib/spawn.in.h @@ -47,6 +47,11 @@ #ifndef _@GUARD_PREFIX@_SPAWN_H #define _@GUARD_PREFIX@_SPAWN_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get definitions of 'struct sched_param' and 'sigset_t'. But avoid namespace pollution on glibc systems. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) diff --git a/lib/ssfmalloc.h b/lib/ssfmalloc.h index 510a08d400..87f44014e4 100644 --- a/lib/ssfmalloc.h +++ b/lib/ssfmalloc.h @@ -78,6 +78,11 @@ beginning of a page sequence returned by ALLOC_PAGES. */ +/* This file uses _GL_CMP. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* =================== Declarations of exported functions =================== */ #include <stdint.h> diff --git a/lib/stack.h b/lib/stack.h index 7a1abafc9c..ab6b873176 100644 --- a/lib/stack.h +++ b/lib/stack.h @@ -58,6 +58,11 @@ #include "xalloc.h" */ +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifndef GL_STACK_ELEMENT # error "Please define GL_STACK_ELEMENT first." #endif diff --git a/lib/stat-time.h b/lib/stat-time.h index 92aa1e64e2..487e8b0971 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h @@ -20,15 +20,18 @@ #ifndef STAT_TIME_H #define STAT_TIME_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_UNUSED, + _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <errno.h> #include <stdckdint.h> #include <stddef.h> #include <sys/stat.h> #include <time.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_STAT_TIME_INLINE # define _GL_STAT_TIME_INLINE _GL_INLINE diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h index b616c100fd..2503817c87 100644 --- a/lib/stdalign.in.h +++ b/lib/stdalign.in.h @@ -37,6 +37,11 @@ #ifndef _@GUARD_PREFIX@_STDALIGN_H #define _@GUARD_PREFIX@_STDALIGN_H +/* This file uses alignof, alignas. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if (defined alignas \ || (defined __STDC_VERSION__ && 202311 <= __STDC_VERSION__) \ || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) diff --git a/lib/stdarg.in.h b/lib/stdarg.in.h index 64baf87f04..8145216e86 100644 --- a/lib/stdarg.in.h +++ b/lib/stdarg.in.h @@ -27,6 +27,11 @@ #ifndef _@GUARD_PREFIX@_STDARG_H #define _@GUARD_PREFIX@_STDARG_H +/* This file uses va_copy. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifndef va_copy # define va_copy(a,b) ((a) = (b)) #endif diff --git a/lib/stddef.in.h b/lib/stddef.in.h index ddbb74cedb..431e819b8b 100644 --- a/lib/stddef.in.h +++ b/lib/stddef.in.h @@ -101,6 +101,11 @@ typedef long max_align_t; # ifndef _@GUARD_PREFIX@_STDDEF_H # define _@GUARD_PREFIX@_STDDEF_H +/* This file uses _Noreturn. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Some platforms lack wchar_t. */ #if !@HAVE_WCHAR_T@ # define wchar_t int diff --git a/lib/stdio-safer.h b/lib/stdio-safer.h index 9d404f1397..d091a25189 100644 --- a/lib/stdio-safer.h +++ b/lib/stdio-safer.h @@ -17,6 +17,11 @@ /* Written by Paul Eggert. */ +/* This file uses _GL_ATTRIBUTE_DEALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdio.h> #if GNULIB_FOPEN_SAFER diff --git a/lib/stdio.in.h b/lib/stdio.in.h index f318014978..9c63e36b2a 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -57,6 +57,12 @@ #ifndef _@GUARD_PREFIX@_STDIO_H #define _@GUARD_PREFIX@_STDIO_H +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_FORMAT, + GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get va_list. Needed on many systems, including glibc 2.8. */ #include <stdarg.h> diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index f79c5a9d29..da827a5c7b 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -37,6 +37,12 @@ #ifndef _@GUARD_PREFIX@_STDLIB_H #define _@GUARD_PREFIX@_STDLIB_H +/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* NetBSD 5.0 mis-defines NULL. */ #include <stddef.h> diff --git a/lib/stdnoreturn.in.h b/lib/stdnoreturn.in.h index 9a304ef05b..d6d4c2adac 100644 --- a/lib/stdnoreturn.in.h +++ b/lib/stdnoreturn.in.h @@ -17,6 +17,11 @@ /* Written by Paul Eggert. */ +/* This file uses _Noreturn. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifndef noreturn /* ISO C11 <stdnoreturn.h> for platforms that lack it. diff --git a/lib/strerror-override.h b/lib/strerror-override.h index 388cc28227..c9b3ba8c19 100644 --- a/lib/strerror-override.h +++ b/lib/strerror-override.h @@ -18,6 +18,11 @@ #ifndef _GL_STRERROR_OVERRIDE_H # define _GL_STRERROR_OVERRIDE_H +/* This file uses _GL_ATTRIBUTE_CONST. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <errno.h> # include <stddef.h> diff --git a/lib/striconv.h b/lib/striconv.h index d0eb8e642d..6cd7dc31cf 100644 --- a/lib/striconv.h +++ b/lib/striconv.h @@ -18,6 +18,11 @@ #ifndef _STRICONV_H #define _STRICONV_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #if HAVE_ICONV #include <iconv.h> diff --git a/lib/striconveh.h b/lib/striconveh.h index 7858b03ef6..6bced43e9c 100644 --- a/lib/striconveh.h +++ b/lib/striconveh.h @@ -18,6 +18,11 @@ #ifndef _STRICONVEH_H #define _STRICONVEH_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #if HAVE_ICONV #include <iconv.h> diff --git a/lib/striconveha.h b/lib/striconveha.h index d0b0f4ddb7..a5c307ea2a 100644 --- a/lib/striconveha.h +++ b/lib/striconveha.h @@ -18,6 +18,11 @@ #ifndef _STRICONVEHA_H #define _STRICONVEHA_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #include "iconveh.h" diff --git a/lib/string-buffer.h b/lib/string-buffer.h index 8e2d80d16e..6cc4a82dec 100644 --- a/lib/string-buffer.h +++ b/lib/string-buffer.h @@ -19,6 +19,11 @@ #ifndef _STRING_BUFFER_H #define _STRING_BUFFER_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdarg.h> #include <stdlib.h> diff --git a/lib/string-desc-quotearg.h b/lib/string-desc-quotearg.h index b7cb306b89..20237a3bc7 100644 --- a/lib/string-desc-quotearg.h +++ b/lib/string-desc-quotearg.h @@ -19,13 +19,16 @@ #ifndef _STRING_DESC_QUOTEARG_H #define _STRING_DESC_QUOTEARG_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "string-desc.h" #include "quotearg.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_STRING_DESC_QUOTEARG_INLINE # define GL_STRING_DESC_QUOTEARG_INLINE _GL_INLINE diff --git a/lib/string-desc.h b/lib/string-desc.h index 9bd086f689..e5204d4ea6 100644 --- a/lib/string-desc.h +++ b/lib/string-desc.h @@ -19,6 +19,12 @@ #ifndef _STRING_DESC_H #define _STRING_DESC_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_NODISCARD. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get ptrdiff_t. */ #include <stddef.h> @@ -32,9 +38,6 @@ #include "idx.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_STRING_DESC_INLINE # define GL_STRING_DESC_INLINE _GL_INLINE diff --git a/lib/string.in.h b/lib/string.in.h index b6bf432e1f..f7e46e936f 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -44,6 +44,12 @@ #ifndef _@GUARD_PREFIX@_STRING_H #define _@GUARD_PREFIX@_STRING_H +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* NetBSD 5.0 mis-defines NULL. */ #include <stddef.h> diff --git a/lib/strings.in.h b/lib/strings.in.h index 2cfe8b1670..bc5c2a1e88 100644 --- a/lib/strings.in.h +++ b/lib/strings.in.h @@ -36,6 +36,11 @@ #ifndef _@GUARD_PREFIX@_STRINGS_H #define _@GUARD_PREFIX@_STRINGS_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if ! @HAVE_DECL_STRNCASECMP@ /* Get size_t. */ # include <stddef.h> diff --git a/lib/strnlen1.h b/lib/strnlen1.h index 9e5b502bef..02dcd4c4ab 100644 --- a/lib/strnlen1.h +++ b/lib/strnlen1.h @@ -17,6 +17,11 @@ #ifndef _STRNLEN1_H #define _STRNLEN1_H +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> diff --git a/lib/sys_file.in.h b/lib/sys_file.in.h index d05337ad42..fb402e04c6 100644 --- a/lib/sys_file.in.h +++ b/lib/sys_file.in.h @@ -32,6 +32,11 @@ #ifndef _@GUARD_PREFIX@_SYS_FILE_H #define _@GUARD_PREFIX@_SYS_FILE_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #ifndef LOCK_SH /* Operations for the 'flock' call (same as Linux kernel constants). */ # define LOCK_SH 1 /* Shared lock. */ diff --git a/lib/sys_ioctl.in.h b/lib/sys_ioctl.in.h index 86840e45a9..48e9c68090 100644 --- a/lib/sys_ioctl.in.h +++ b/lib/sys_ioctl.in.h @@ -29,6 +29,11 @@ #ifndef _@GUARD_PREFIX@_SYS_IOCTL_H #define _@GUARD_PREFIX@_SYS_IOCTL_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>, but not in <sys/ioctl.h>. Haiku declares ioctl() in <unistd.h>, but not in <sys/ioctl.h>. diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h index 8dca132683..35fd47b6b5 100644 --- a/lib/sys_random.in.h +++ b/lib/sys_random.in.h @@ -45,6 +45,11 @@ #ifndef _@GUARD_PREFIX@_SYS_RANDOM_H #define _@GUARD_PREFIX@_SYS_RANDOM_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <sys/types.h> /* Define the GRND_* constants. */ diff --git a/lib/sys_resource.in.h b/lib/sys_resource.in.h index b0af9aa289..d7b898824e 100644 --- a/lib/sys_resource.in.h +++ b/lib/sys_resource.in.h @@ -36,6 +36,11 @@ #ifndef _@GUARD_PREFIX@_SYS_RESOURCE_H #define _@GUARD_PREFIX@_SYS_RESOURCE_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if !@HAVE_SYS_RESOURCE_H@ /* A platform that lacks <sys/resource.h>. */ diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 13440fa6f0..e817274181 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -71,6 +71,11 @@ #ifndef _@GUARD_PREFIX@_SYS_SELECT_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* On many platforms, <sys/select.h> assumes prior inclusion of <sys/types.h>. Also, mingw defines sigset_t there, instead of in <signal.h> where it belongs. */ diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index 6705593f4a..a3c0e834f4 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -63,9 +63,12 @@ #ifndef _@GUARD_PREFIX@_SYS_SOCKET_H #define _@GUARD_PREFIX@_SYS_SOCKET_H -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK, + alignof. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + _GL_INLINE_HEADER_BEGIN #ifndef _GL_SYS_SOCKET_INLINE # define _GL_SYS_SOCKET_INLINE _GL_INLINE diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 0c2f39c12b..cbf98d9177 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -48,6 +48,11 @@ #ifndef _@GUARD_PREFIX@_SYS_STAT_H #define _@GUARD_PREFIX@_SYS_STAT_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h index e833d55167..62cd6bcd35 100644 --- a/lib/sys_time.in.h +++ b/lib/sys_time.in.h @@ -41,6 +41,11 @@ #ifndef _@GUARD_PREFIX@_SYS_TIME_H #define _@GUARD_PREFIX@_SYS_TIME_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if ! @HAVE_SYS_TIME_H@ # include <time.h> #endif diff --git a/lib/sys_times.in.h b/lib/sys_times.in.h index 148dc60db9..6977f70318 100644 --- a/lib/sys_times.in.h +++ b/lib/sys_times.in.h @@ -32,6 +32,11 @@ # define _@GUARD_PREFIX@_SYS_TIMES_H +/* This file uses GNULIB_POSIXCHECK. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + /* Get clock_t. But avoid namespace pollution on glibc systems. */ # ifndef __GLIBC__ diff --git a/lib/sys_utsname.in.h b/lib/sys_utsname.in.h index 4420d94ef4..db689116df 100644 --- a/lib/sys_utsname.in.h +++ b/lib/sys_utsname.in.h @@ -35,6 +35,11 @@ #define _@GUARD_PREFIX@_SYS_UTSNAME_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ diff --git a/lib/sys_wait.in.h b/lib/sys_wait.in.h index 6454eb5ad7..15d8ab28f1 100644 --- a/lib/sys_wait.in.h +++ b/lib/sys_wait.in.h @@ -30,6 +30,11 @@ #ifndef _@GUARD_PREFIX@_SYS_WAIT_H #define _@GUARD_PREFIX@_SYS_WAIT_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get pid_t. */ #include <sys/types.h> diff --git a/lib/system-quote.h b/lib/system-quote.h index 2046c06a7e..870a5c1107 100644 --- a/lib/system-quote.h +++ b/lib/system-quote.h @@ -46,6 +46,11 @@ is to truncate the entire command line. */ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #ifdef __cplusplus diff --git a/lib/term-style-control.h b/lib/term-style-control.h index 4e14c7c5b1..6b77277cf3 100644 --- a/lib/term-style-control.h +++ b/lib/term-style-control.h @@ -21,6 +21,11 @@ /* The user of this file will define a macro 'term_style_user_data', such that 'struct term_style_user_data' is a user-defined struct. */ +/* This file uses _GL_ASYNC_SAFE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* The amount of control to take over the underlying tty in order to avoid garbled output on the screen, due to interleaved output of escape sequences diff --git a/lib/termios.in.h b/lib/termios.in.h index aa3a7cc9d9..2b64250d55 100644 --- a/lib/termios.in.h +++ b/lib/termios.in.h @@ -40,6 +40,11 @@ extern "C" { #ifndef _@GUARD_PREFIX@_TERMIOS_H #define _@GUARD_PREFIX@_TERMIOS_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get pid_t. */ #include <sys/types.h> diff --git a/lib/textstyle.in.h b/lib/textstyle.in.h index 38645bf6f8..c87fa38059 100644 --- a/lib/textstyle.in.h +++ b/lib/textstyle.in.h @@ -30,6 +30,11 @@ #ifndef _TEXTSTYLE_H #define _TEXTSTYLE_H +/* This file uses _GL_ATTRIBUTE_MAYBE_UNUSED, HAVE_TCDRAIN. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <errno.h> #include <stdarg.h> #include <stddef.h> diff --git a/lib/threads.in.h b/lib/threads.in.h index 2bc0f23b32..ff01b50cbb 100644 --- a/lib/threads.in.h +++ b/lib/threads.in.h @@ -47,6 +47,11 @@ #ifndef _@GUARD_PREFIX@_THREADS_H #define _@GUARD_PREFIX@_THREADS_H +/* This file uses _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, _Thread_local. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if !@HAVE_THREADS_H@ # include <time.h> diff --git a/lib/time.in.h b/lib/time.in.h index f9b517a3dd..39dc1e4369 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -45,6 +45,11 @@ # @INCLUDE_NEXT@ @NEXT_TIME_H@ +/* This file uses _GL_ATTRIBUTE_DEPRECATED, GNULIB_POSIXCHECK. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + /* NetBSD 5.0 mis-defines NULL. */ # include <stddef.h> diff --git a/lib/timespec.h b/lib/timespec.h index ba78647f09..0bdfd76ef7 100644 --- a/lib/timespec.h +++ b/lib/timespec.h @@ -19,11 +19,14 @@ #if ! defined TIMESPEC_H #define TIMESPEC_H -#include <time.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_CONST, + _GL_ATTRIBUTE_PURE, _GL_CMP. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <time.h> + _GL_INLINE_HEADER_BEGIN #ifndef _GL_TIMESPEC_INLINE # define _GL_TIMESPEC_INLINE _GL_INLINE diff --git a/lib/trim.h b/lib/trim.h index b558fb218a..a8040ef3ad 100644 --- a/lib/trim.h +++ b/lib/trim.h @@ -16,6 +16,11 @@ /* Written by Davide Angelocola <davide.angeloc...@gmail.com> */ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> /* Trim mode. */ diff --git a/lib/u64.h b/lib/u64.h index 0353ad4d9a..8a99335b6a 100644 --- a/lib/u64.h +++ b/lib/u64.h @@ -17,11 +17,13 @@ /* Written by Paul Eggert. */ -#include <stdint.h> - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include <stdint.h> + _GL_INLINE_HEADER_BEGIN #ifndef _GL_U64_INLINE # define _GL_U64_INLINE _GL_INLINE diff --git a/lib/uchar.in.h b/lib/uchar.in.h index 27b91c5b58..aaba0b604a 100644 --- a/lib/uchar.in.h +++ b/lib/uchar.in.h @@ -43,6 +43,12 @@ # @INCLUDE_NEXT@ @NEXT_UCHAR_H@ #endif +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_BEGIN_C_LINKAGE, + _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get uint_least16_t, uint_least32_t. */ #include <stdint.h> @@ -66,9 +72,6 @@ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 8ba9867894..93ca7a97f9 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -69,6 +69,11 @@ #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H #define _@GUARD_PREFIX@_UNISTD_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ /* But avoid namespace pollution on glibc systems. */ #ifndef __GLIBC__ @@ -170,9 +175,6 @@ # include <getopt-pfx-core.h> #endif -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_UNISTD_INLINE # define _GL_UNISTD_INLINE _GL_INLINE diff --git a/lib/utime.in.h b/lib/utime.in.h index b185019176..384271434a 100644 --- a/lib/utime.in.h +++ b/lib/utime.in.h @@ -29,6 +29,11 @@ #ifndef _@GUARD_PREFIX@_UTIME_H #define _@GUARD_PREFIX@_UTIME_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if !@HAVE_UTIME_H@ # include <sys/utime.h> #endif diff --git a/lib/utimens.h b/lib/utimens.h index a7056981f3..4a21792a7e 100644 --- a/lib/utimens.h +++ b/lib/utimens.h @@ -17,6 +17,11 @@ /* Written by Paul Eggert. */ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <time.h> int fdutimens (int, char const *, struct timespec const [2]); int utimens (char const *, struct timespec const [2]); @@ -26,9 +31,6 @@ int lutimens (char const *, struct timespec const [2]); # include <fcntl.h> # include <sys/stat.h> -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_UTIMENS_INLINE # define _GL_UTIMENS_INLINE _GL_INLINE diff --git a/lib/utmp.in.h b/lib/utmp.in.h index 2c8c79d129..895704cb1b 100644 --- a/lib/utmp.in.h +++ b/lib/utmp.in.h @@ -32,6 +32,11 @@ #ifndef _@GUARD_PREFIX@_UTMP_H #define _@GUARD_PREFIX@_UTMP_H +/* This file uses GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* FreeBSD, NetBSD, OpenBSD, macOS, Minix, Haiku declare login_tty in <util.h> or <libutil.h>, not in <utmp.h>. Solaris declares it in <termios.h>, not in <utmp.h>. */ diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h index f69649fb45..2d13407079 100644 --- a/lib/vasnprintf.h +++ b/lib/vasnprintf.h @@ -17,6 +17,11 @@ #ifndef _VASNPRINTF_H #define _VASNPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get va_list. */ #include <stdarg.h> diff --git a/lib/verror.h b/lib/verror.h index 8917988db6..bd385e1ef5 100644 --- a/lib/verror.h +++ b/lib/verror.h @@ -17,6 +17,11 @@ #ifndef _VERROR_H #define _VERROR_H 1 +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdarg.h> /* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */ diff --git a/lib/version-etc.h b/lib/version-etc.h index 58297fc349..2313d98b3f 100644 --- a/lib/version-etc.h +++ b/lib/version-etc.h @@ -19,6 +19,11 @@ #ifndef VERSION_ETC_H # define VERSION_ETC_H 1 +/* This file uses _GL_ATTRIBUTE_SENTINEL. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include <stdarg.h> # include <stdio.h> diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 194a1c6723..b2620ad92e 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -84,6 +84,12 @@ #ifndef _@GUARD_PREFIX@_WCHAR_H #define _@GUARD_PREFIX@_WCHAR_H +/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers that can be freed by passing them as the Ith argument to the function F. */ diff --git a/lib/wctype.in.h b/lib/wctype.in.h index f6e474d38d..22fa1df239 100644 --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -44,6 +44,11 @@ #ifndef _@GUARD_PREFIX@_WCTYPE_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #if @HAVE_WINT_T@ /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ # include <wchar.h> @@ -68,9 +73,6 @@ #ifndef _@GUARD_PREFIX@_WCTYPE_H #define _@GUARD_PREFIX@_WCTYPE_H -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_WCTYPE_INLINE # define _GL_WCTYPE_INLINE _GL_INLINE diff --git a/lib/windows-spawn.h b/lib/windows-spawn.h index 42c5af7717..b218181803 100644 --- a/lib/windows-spawn.h +++ b/lib/windows-spawn.h @@ -18,6 +18,11 @@ #ifndef _WINDOWS_SPAWN_H #define _WINDOWS_SPAWN_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdint.h> #include <stdlib.h> diff --git a/lib/windows-thread.h b/lib/windows-thread.h index 68b8e96813..e6511d736e 100644 --- a/lib/windows-thread.h +++ b/lib/windows-thread.h @@ -20,6 +20,11 @@ #ifndef _WINDOWS_THREAD_H #define _WINDOWS_THREAD_H +/* This file uses _Noreturn. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #define WIN32_LEAN_AND_MEAN /* avoid including junk */ #include <windows.h> diff --git a/lib/xalloc.h b/lib/xalloc.h index f373c2fe59..0a951e1d59 100644 --- a/lib/xalloc.h +++ b/lib/xalloc.h @@ -18,6 +18,13 @@ #ifndef XALLOC_H_ #define XALLOC_H_ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _Noreturn, + _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_MALLOC, + _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #include <stdlib.h> @@ -25,9 +32,6 @@ # include "idx.h" #endif -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef XALLOC_INLINE # define XALLOC_INLINE _GL_INLINE diff --git a/lib/xbinary-io.h b/lib/xbinary-io.h index e66df769f4..d38256b489 100644 --- a/lib/xbinary-io.h +++ b/lib/xbinary-io.h @@ -17,11 +17,13 @@ #ifndef _XBINARY_IO_H #define _XBINARY_IO_H -#include "binary-io.h" - -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _Noreturn. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + +#include "binary-io.h" + _GL_INLINE_HEADER_BEGIN #ifndef XBINARY_IO_INLINE # define XBINARY_IO_INLINE _GL_INLINE diff --git a/lib/xgetcwd.h b/lib/xgetcwd.h index 7467bc7bf1..59d225e642 100644 --- a/lib/xgetcwd.h +++ b/lib/xgetcwd.h @@ -14,6 +14,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> extern char *xgetcwd (void) diff --git a/lib/xgetdomainname.h b/lib/xgetdomainname.h index 2d4d67bdf2..86b8b18b80 100644 --- a/lib/xgetdomainname.h +++ b/lib/xgetdomainname.h @@ -18,6 +18,11 @@ #ifndef _XGETDOMAINNAME_H #define _XGETDOMAINNAME_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> /* Return the NIS domain name of the machine, in malloc'd storage. diff --git a/lib/xgethostname.h b/lib/xgethostname.h index aad35601a8..c404b77439 100644 --- a/lib/xgethostname.h +++ b/lib/xgethostname.h @@ -15,6 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> char *xgethostname (void) diff --git a/lib/xmalloca.h b/lib/xmalloca.h index 4b1bd470c2..3f03eba5aa 100644 --- a/lib/xmalloca.h +++ b/lib/xmalloca.h @@ -18,6 +18,12 @@ #ifndef _XMALLOCA_H #define _XMALLOCA_H +/* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_DEALLOC, + _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include "malloca.h" #include "xalloc.h" #include "xalloc-oversized.h" diff --git a/lib/xmemdup0.h b/lib/xmemdup0.h index 4f9888c314..256cb4e966 100644 --- a/lib/xmemdup0.h +++ b/lib/xmemdup0.h @@ -18,6 +18,11 @@ #ifndef XMEMDUP_H_ # define XMEMDUP_H_ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + # include <stdlib.h> diff --git a/lib/xprintf.h b/lib/xprintf.h index ae1ea8f71d..3e05290299 100644 --- a/lib/xprintf.h +++ b/lib/xprintf.h @@ -17,6 +17,11 @@ #ifndef _XPRINTF_H #define _XPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdarg.h> #include <stdio.h> diff --git a/lib/xreadlink.h b/lib/xreadlink.h index 48438ce7cb..44f848f86d 100644 --- a/lib/xreadlink.h +++ b/lib/xreadlink.h @@ -18,6 +18,11 @@ /* Written by Jim Meyering <j...@meyering.net> */ +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> extern char *xreadlink (char const *filename) diff --git a/lib/xsize.h b/lib/xsize.h index 1ec78e776f..746d6569bf 100644 --- a/lib/xsize.h +++ b/lib/xsize.h @@ -18,6 +18,11 @@ #ifndef _XSIZE_H #define _XSIZE_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get size_t. */ #include <stddef.h> @@ -30,9 +35,6 @@ /* Get ATTRIBUTE_PURE. */ #include "attribute.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef XSIZE_INLINE # define XSIZE_INLINE _GL_INLINE diff --git a/lib/xstriconv.h b/lib/xstriconv.h index f693194f8d..ee17e490c5 100644 --- a/lib/xstriconv.h +++ b/lib/xstriconv.h @@ -18,6 +18,11 @@ #ifndef _XSTRICONV_H #define _XSTRICONV_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> #if HAVE_ICONV #include <iconv.h> diff --git a/lib/xstriconveh.h b/lib/xstriconveh.h index bb3c3a8db0..fe15eed912 100644 --- a/lib/xstriconveh.h +++ b/lib/xstriconveh.h @@ -18,6 +18,11 @@ #ifndef _XSTRICONVEH_H #define _XSTRICONVEH_H +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> /* Get the 'enum iconv_ilseq_handler' and iconveh_t types, and the diff --git a/lib/xstring-desc.h b/lib/xstring-desc.h index b07831baf4..cbc0f97eab 100644 --- a/lib/xstring-desc.h +++ b/lib/xstring-desc.h @@ -19,14 +19,16 @@ #ifndef _XSTRING_DESC_H #define _XSTRING_DESC_H 1 +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <string.h> #include "string-desc.h" #include "xalloc.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef GL_XSTRING_DESC_INLINE # define GL_XSTRING_DESC_INLINE _GL_INLINE diff --git a/lib/xstrndup.h b/lib/xstrndup.h index 502881ea3d..5844731010 100644 --- a/lib/xstrndup.h +++ b/lib/xstrndup.h @@ -15,6 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stdlib.h> /* Return a newly allocated copy of at most N bytes of STRING. diff --git a/lib/xstrtol-error.h b/lib/xstrtol-error.h index d8892ea871..0872f590d9 100644 --- a/lib/xstrtol-error.h +++ b/lib/xstrtol-error.h @@ -19,6 +19,11 @@ #ifndef XSTRTOL_ERROR_H_ # define XSTRTOL_ERROR_H_ 1 +/* This file uses _Noreturn. */ +# if !_GL_CONFIG_H_INCLUDED +# error "Please include config.h first." +# endif + # include "xstrtol.h" # include <getopt.h> diff --git a/lib/xtime.h b/lib/xtime.h index ddad01ed47..84a8a5db9a 100644 --- a/lib/xtime.h +++ b/lib/xtime.h @@ -20,9 +20,11 @@ #ifndef XTIME_H_ #define XTIME_H_ 1 -#ifndef _GL_INLINE_HEADER_BEGIN +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +#if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif + _GL_INLINE_HEADER_BEGIN #ifndef XTIME_INLINE # define XTIME_INLINE _GL_INLINE diff --git a/lib/xvasprintf.h b/lib/xvasprintf.h index 2f941ab22a..6a5952faa6 100644 --- a/lib/xvasprintf.h +++ b/lib/xvasprintf.h @@ -17,6 +17,11 @@ #ifndef _XVASPRINTF_H #define _XVASPRINTF_H +/* This file uses _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get va_list. */ #include <stdarg.h> diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 0df2181871..0216017461 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 83 +# gnulib-common.m4 serial 84 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -15,6 +15,10 @@ AC_DEFUN([gl_COMMON] AC_REQUIRE([gl_ZZGNULIB]) ]) AC_DEFUN([gl_COMMON_BODY], [ + AH_VERBATIM([0witness], +[/* Witness that <config.h> has been included. */ +#define _GL_CONFIG_H_INCLUDED 1 +]) AH_VERBATIM([_GL_GNUC_PREREQ], [/* True if the compiler says it groks GNU C version MAJOR.MINOR. */ #if defined __GNUC__ && defined __GNUC_MINOR__ -- 2.34.1