How to disable gcc warning "floating constant exceeds range" and "floating constant truncated to zero"?

These nasty warnings are enabled by default in the current gcc, and I cannot find which parameter to disable. They generate warning spam and prevent compilation with -Werrorin code, where gcc behavior warns about this intentionally (and comes from general-purpose macros that cannot easily avoid creating such constants).

+3
source share
2 answers

After digging the GCC source code, I found that the warnings you described were part of the option -Woverflow. So just turn off this warning.

, :

C ++ ... , .

+3

GCC 4.8 , :

floating constant exceeds range of 'double' [-Woverflow]

, GCC.

+2

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


All Articles