--- Comment #10 from jengliang at gmail dot com 2010-03-06 01:37 ---
Hi Manuel,
I think it is a good idea to warn about narrowing both from a type to another
type, and from a type to a bit-field. For new codes, one should use the
bit-masking technique for bit-field narrowing just as on
--- Comment #9 from Zachary_Deretsky at mentor dot com 2010-03-06 00:20
---
I was wrong, the warning is correct and there is a way to fix it.
***1. The easy recipe: For the assignment to bit-fileds use unsigned int
bit-field on the left and mask the right side with the appropriate mask
--- Comment #8 from Zachary_Deretsky at mentor dot com 2010-02-18 20:50
---
With -Wconversion for the assignment to bitfields gcc 4.4.2 gives a
warning, which is impossible to fix.
This BUG (I hope everybody agrees it is a BUG) gives us a lot of
trouble while porting our code (45 devel
--- Comment #7 from faure at kde dot org 2010-01-13 13:40 ---
I agree with Tom, the new behavior of -Wconversion is useless with bitfields,
this should be fixed so that we can use -Wconversion again.
Why is this bug on "WAITING"?
--
faure at kde dot org changed:
What|
--- Comment #6 from tom at atoptech dot com 2009-03-10 20:34 ---
Subject: Re: cannot silence -Wconversion warnings for
bit-fields
> AFAIK, that is not true. I just tried your very example with gcc 4.2.4 and it
> doesn't warn with -Wall -Wextra -Wconversion. g++ did warn but no
--- Comment #5 from manu at gcc dot gnu dot org 2009-03-10 19:15 ---
(In reply to comment #4)
>
> The previous version of "gcc" warned when implicit narrowing of doubles to
> integral values, such as
>
> double n = 0.05;
> int d = n;
>
> when using the "-Wall" option.
--- Comment #4 from tom at atoptech dot com 2009-03-10 17:40 ---
Manuel,
You miss understood what I meant by "old behavior was just fine". I was saying
that the previous behavior of "gcc" worked fine and I was NOT referring
specifically to the "-Wconversion" option.
The previous versi
--- Comment #3 from manu at gcc dot gnu dot org 2009-03-08 03:30 ---
> The old behavior was just fine!
You absolutely did not understand what the old -Wconversion did.
http://gcc.gnu.org/wiki/NewWconversion
But if you still want the old behaviour, just use -Wtraditional-conversion.