|
From: | Jeffrey Johnson |
Subject: | GNULIB is adding -Wmissing-prototypes in config.h |
Date: | Mon, 10 Jul 2017 14:02:15 -0400 |
This is a minor (but annoying warning spewage) gnulib addition to config.h when compiling with G++ In file included from <command-line>:0:0: ./../../config.h:10238:5: warning: option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ [-Wpragmas] _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ ^ The code around line 10238 in config.h looks like this: #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 # 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 Conditioning the define with “#ifndef __cplusplus” makes the warning go away: _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ $ g++ --version g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) hth 73 de Jeff |
[Prev in Thread] | Current Thread | [Next in Thread] |