signed/unsigned comparison warning level
Manuel López-Ibáñez
lopezibanez@gmail.com
Mon Sep 27 18:09:00 GMT 2010
On 27 September 2010 05:19, J Decker <d3ck0r@gmail.com> wrote:
>
> I don't know why standards left this open, other than there isn't a
> single-instruction translation from code to CPU for the comparison;
>
> But if it's not fixed, this warning should definatly be issued at
> default warning level. This should be more like 'if this comparison
> can be wrong, it will be wrong'.
Please, see
http://c-faq.com/expr/preservingrules.html
The warnings that you want are Wsign-compare and Wsign-conversion.
They are not enabled by default because they produce a lot of false
positives:
http://gcc.gnu.org/wiki/NewWconversion#Frequently_Asked_Questions
Cheers,
Manuel.
More information about the Gcc
mailing list