Warning when compiling with -pedantic, and fix

"raphael.huck" <[email protected]>
Newsgroups gmane.text.clearsilver.general
Message-ID <[email protected]>
When compiling with -pedantic, gcc complains:

util/neo_err.h:75:25: warning: ISO C does not permit named variadic 
macros
util/neo_err.h:89:31: warning: ISO C does not permit named variadic 
macros
util/neo_err.h:126:28: warning: ISO C does not permit named variadic 
macros

After replacing:

#ifdef __GNUC__
#define nerr_raise(e,f,a...) \
   nerr_raisef(__PRETTY_FUNCTION__,__FILE__,__LINE__,e,f,##a)
#else
#define nerr_raise(e,f,...) \
   nerr_raisef(__PRETTY_FUNCTION__,__FILE__,__LINE__,e,f,__VA_ARGS__)
#endif

with:

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define nerr_raise(e,f,...) \
   nerr_raisef(__PRETTY_FUNCTION__,__FILE__,__LINE__,e,f,__VA_ARGS__)
#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)
#define nerr_raise(e,f,a...) \
   nerr_raisef(__PRETTY_FUNCTION__,__FILE__,__LINE__,e,f,##a)
#else
#error The compiler is missing support for variable-argument macros.
#endif

gcc no longer complains, and everything is fine ;)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.