This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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);
   ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]