[Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 4 16:31:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61412

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
cat > sys/h.h <<EOT
#define X(I) char c = { I }
EOT
cat > C.C << EOT
#include <h.h>
int main () {
  int i = 256;
  X(i);
}
EOT
g++ -isystem sys C.C -Wall
g++ -isystem sys C.C -Wall -Wsystem-headers
In file included from C.C:1:0:
C.C: In function ‘int main()’:
C.C:4:3: warning: narrowing conversion of ‘i’ from ‘int’ to ‘char’ inside { }
is ill-formed in C++11 [-Wnarrowing]
   X(i);
   ^


More information about the Gcc-bugs mailing list