This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4.3] wcoercion (3): conversion_warnings for C / C++
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Manuel Lopez-Ibanez <lopezibanez at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 15 Nov 2006 16:35:10 +0000 (UTC)
- Subject: Re: [4.3] wcoercion (3): conversion_warnings for C / C++
- References: <6c33472e0611050636q40256ddalcd215f12bfc4ca58@mail.gmail.com>
On Sun, 5 Nov 2006, Manuel Lopez-Ibanez wrote:
> This patch adds most of the new functionality of Wconversion: warn for
> implicit
> conversions that may alter a value. This includes conversions between
> real and integer, like abs (x) when x is double; conversions between
> signed and unsigned, like unsigned ui = -1; and conversions to smaller
> types, like sqrtf (M_PI). Do not warn for explicit casts like abs
> ((int) x) and ui = (unsigned) -1, or if the value is not changed by
> the conversion like abs (2.0).
This is OK.
Do you warn for potentially value-changing conversions between binary and
decimal floating point types, or is that covered by another patch or
another testcase?
--
Joseph S. Myers
joseph@codesourcery.com