Discussion:
GNULIB is adding -Wmissing-prototypes in config.h
Jeffrey Johnson
2017-07-10 18:38:34 UTC
Permalink
Subject: GNULIB is adding -Wmissing-prototypes in config.h
Date: July 10, 2017 at 2:02:15 PM EDT
This is a minor (but annoying warning spewage) gnulib addition to config.h when compiling with G++
./../../config.h:10238:5: warning: option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ [-Wpragmas]
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
^
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
# define _GL_INLINE_HEADER_CONST_PRAGMA
# else
# define _GL_INLINE_HEADER_CONST_PRAGMA \
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
# endif
/* Suppress GCC's bogus "no previous prototype for 'FOO'"
and "no previous declaration for 'FOO'" diagnostics,
when FOO is an inline function in the header; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>>. */
# define _GL_INLINE_HEADER_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
_Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
_GL_INLINE_HEADER_CONST_PRAGMA
# define _GL_INLINE_HEADER_END \
_Pragma ("GCC diagnostic pop")
#else
# define _GL_INLINE_HEADER_BEGIN
# define _GL_INLINE_HEADER_END
#endif
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
$ g++ --version
g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
hth
73 de Jeff
Paul Eggert
2017-07-10 21:18:44 UTC
Permalink
I suggest upgrading to the current version of Gnulib. This patch:

http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=44f73b8deccadf3e0d668f493d7dc3babcaa3144

dated 2015 should work around your particular problem. Perhaps a
different patch might be needed for g++ 4.6, though I'd like some
confirmation of that from someone actually using old g++.
Jeffrey Johnson
2017-07-11 08:47:45 UTC
Permalink
Thanks for the pointer.
Post by Paul Eggert
http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=44f73b8deccadf3e0d668f493d7dc3babcaa3144
dated 2015 should work around your particular problem. Perhaps a different patch might be needed for g++ 4.6, though I'd like some confirmation of that from someone actually using old g++.
Hmmm … I’m using an up-to-date git checkout of gnulib, so the problem isn’t simply an upgrade.

Copying extern-inlines.m4 into my top-level m4 “fixes” the problem (even though the timestamp
seemed to indicate that the file had already been copied).

So the root cause to my problem is/was a failed gnulib update integration somehow.

*shrug* My eyes are MUCH happier not having to squint around the annoying warning ;-). Thanks!

73 de Jeff

Loading...