GCC - shouldn't a warning be issued when assigning an int to a char?

前端 未结 6 2023
你的背包
你的背包 2020-12-19 05:47

I\'ve recently set up a MinGW + MSYS environment on my laptop to check how things are with Netbeans C/C++ support. Everything seems to work fine, however, during my testing

6条回答
  •  难免孤独
    2020-12-19 06:09

    -Wall doesn't quite mean -Wall, -Wextra is already under fire for being a little overly pedantic.

    As Christoph said, you are looking for -Wconversion. Its good to really dig in to what -Wall and -Wextra actually turn on, and just specify the -W flags you want in your make file, especially if treating warnings as errors.

提交回复
热议问题