This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -Wconversion producing incorrect warning
- From: John Love-Jensen <eljay at adobe dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>, "Kevin P. Fleming" <kpfleming at starnetworks dot us>
- Cc: MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Fri, 04 Nov 2005 06:20:21 -0600
- Subject: Re: -Wconversion producing incorrect warning
Hi Segher,
> The problem here is, that -Wconversion does _not_ warn about type conversions
in your code!
From: http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/Warning-Options.html
-------------------------------------------------------------------
-Wconversion
Warn if a prototype causes a type conversion that is different from what
would happen to the same argument in the absence of a prototype. This
includes conversions of fixed point to floating and vice versa, and
conversions changing the width or signedness of a fixed point argument
except when the same as the default promotion.
Also, warn if a negative integer constant expression is implicitly converted
to an unsigned type. For example, warn about the assignment x = -1 if x is
unsigned. But do not warn about explicit casts like (unsigned) -1.
-------------------------------------------------------------------
What kind of type conversions in your code are you referring to?
--Eljay