How to disable warning: binary constants is a GCC extension

How to disable "warning: binary constants is a GCC extension"?

I have active -Wextra -pedantic and you want to disable the warning above? How to do this without inadvertently disabling some other warnings?

+4
source share
1 answer

As a rule, you can find out which switch controls the warning with the option

-fdiagnostics-show-option 

But this warning says:

 warning: binary constants are a GCC extension [enabled by default] 

As an extension tool, it is activated using -pedantic

Here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23479#c3 adding a warning to -Wgcc-extensions was discussed, but this switch does not exist.

From the manual at http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/C-Extensions.html#C-Extensions

GNU C provides several language functions not found in the ISO C standard. (The -pedantic parameter allows GCC to print a warning message if any of these functions are used.) To check for these functions in conditional compilation, check for a predefined GNUC macro that always defined under GCC.

+1
source

Source: https://habr.com/ru/post/1497656/


All Articles