[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: GCC feature req: warn when bitops exceed type size (was:  	conntrack untracked match is broken)
From:       Manuel_López-Ibáñez <lopezibanez () gmail ! com>
Date:       2009-06-29 21:48:18
Message-ID: 6c33472e0906291448v3d00c6cbqc91d04f9c92b585 () mail ! gmail ! com
[Download RAW message or body]

2009/6/29 Jan Engelhardt <jengelh@medozas.de>:
>
> 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.

A lot of false warnings were fixed in GCC 4.4 and 4.5. And if only
truncation problems with literals were warned then your original
example wouldn't had been.

Cheers,

Manuel.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic