Re: [C PATCH] Make -Wdiv-by-zero work even for const ints (PR c/64440)

2015-01-06 Thread Joseph Myers
On Tue, 6 Jan 2015, Marek Polacek wrote: > Currently the C FE's -Wdiv-by-zero warns only for INTEGER_CSTs, > unlike C++, which can also handle const ints (yes, different > constant expression rules). But since it's easy to warn for > consts in the C FE as well, and we already warn for shifts > wi

[C PATCH] Make -Wdiv-by-zero work even for const ints (PR c/64440)

2015-01-06 Thread Marek Polacek
Currently the C FE's -Wdiv-by-zero warns only for INTEGER_CSTs, unlike C++, which can also handle const ints (yes, different constant expression rules). But since it's easy to warn for consts in the C FE as well, and we already warn for shifts with const ints, I think we can go with the following.