This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC feature req: warn when bitops exceed type size (was: conntrack untracked match is broken)
On Monday 2009-06-29 16:09, Manuel LÃpez-IbÃÃez wrote:
>2009/6/29 Richard Guenther wrote:
>> On Mon, Jun 29, 2009 at 3:10 PM, Jan Engelhardt wrote:
>>> Hi gcc list,
>>>
>>>
>>> I am forwarding below's bugreport here(*), to implicitly make aware
>>> of a feature that I deem important to have in a future gcc.
>>>
>>
>> -Wconversion should say
>>
>> t.c:4: warning: conversion to âunsigned charâ from âintâ may alter its value
I added -Wconversion to the Linux kernel's global cflags (KBUILD_CFLAGS)
just to see what would happen. As I expected, I get swamped with
warnings, like "conversion to int from unsigned int". All legitimate in
themselves, I would have preferred an option (or even no option at all,
given that the "large integer implicitly truncated to unsigned type"
warning is shown without any -W flags) that only flags up truncation
problems with literals.