-Wno-pedantic ignored on older gcc

1.3k views Asked by At

I have a C++ application where I am using zero-arguments-variadic macros. However, I don't really like the standard conforming solution posted here on SO in various answers, but rather keep the GCC specific ##__VAR_ARGS__.

I'd like to catch as much warnings as possible though.

My build system is meson and I passed the options --buildtype=debugoptimized --warning_level=2 --werror=true and specify -Wno-pedantic as an addtional project argument.

Ob Ubuntu 18.04, gcc 7.3.0, meson 0.45.1 this adds the following options to the compiler: -Wall -Wextra -Werror -Wpedantic -Wno-pedantic -std=c++11 and everything builds fine.

The same code, the same options on CentOS 7.4.1708, gcc 4.8.5, meson 0.44.1 adds extactly the same options to the compiler but does not compile and I get the following error:

ISO C99 requires rest arguments to be used (for the variadic macros)

It seems that -Wno-pedantic is ignored in this compiler.

I can play around with the warning options a bit, but either on Ubuntu or CentOS the build is failing. When the Ubuntu build fails, the error message is a bit different:

ISO C++11 requires at least one argument for the "..." in a variadic macro

The only solution to make both builds succeed I found so far is using meson --buildtype=plain --warning_level=1 -werror=true and setting -Wall -Wextra as project arguments.

So I'm not sure if this is a compiler issue, a meson issue or just some unfortunate version difference I'm hitting.

0

There are 0 answers