Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable warning: binary constants are a GCC extension

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

I have active -Wextra -pedantic and want to disable above warning? How to do it without unintentionally disable some other warning?

like image 695
Ivan Cenov Avatar asked Aug 18 '13 11:08

Ivan Cenov


1 Answers

Generally you can find out which switch controls which warning with the option

-fdiagnostics-show-option

But this warning says:

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

Being an extension means, it is enabled with -pedantic

Here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23479#c3 it has been discussed to add the warning to -Wgcc-extensions, but that switch doesn't 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 features not found in ISO standard C. (The -pedantic option directs GCC to print a warning message if any of these features is used.) To test for the availability of these features in conditional compilation, check for a predefined macro GNUC, which is always defined under GCC.

like image 155
Yamakuzure Avatar answered Oct 22 '22 20:10

Yamakuzure