Warning : overflow in implicit constant conversion

前端 未结 4 2088
醉话见心
醉话见心 2021-01-01 17:30

In the following program, the line 5 does give overflow warning as expected, but surprisingly the line 4 doesn\'t give any warning in GCC: http://www.ideone.com/U0

4条回答
  •  我在风中等你
    2021-01-01 18:24

    -Wall doesn't include many options. -Wconversion is one of them and warns about the behavior you're interested in.

    See http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

提交回复
热议问题