[cfe-dev] uninitialized variable warning, etc

रजनीश rdogra at earthlink.net
Sun Mar 8 22:48:27 PDT 2009


fyi,

this example fails your new test.

libavcodec/mpeg12enc.c:756:19: warning: use of unary operator that may  
be intended as compound assignment (-=)
             for(mv=-MAX_MV; mv<=MAX_MV; mv++){
                   ^~


On Mar 7, 2009, at 10:52 PM, Chris Lattner wrote:

>
> On Mar 7, 2009, at 1:46 PM, Eli Friedman wrote:
>
>> On Sat, Mar 7, 2009 at 12:24 AM, Chris Lattner <clattner at apple.com>  
>> wrote:
>>> On Mar 6, 2009, at 11:45 PM, रजनीश wrote:
>>>>
>>>> Here are some examples taken from ffmpeg-export-2008-12-18
>>>
>>> These are all exactly the sorts of things that the warning was  
>>> designed to
>>> catch.  Are spaces really that horrible to use? :)
>>
>> Trying to dictate a coding style using compiler warnings isn't
>> productive.
>
> I completely disagree. Warnings are *all about* (optionally, when  
> enabled) forcing coding standards on people.  Warnings are  
> inherently about code that is valid but dubious.
>
>> I like the suggestion that we should warn on "=- " (with
>> a trailing space), but not not just "=-"; the false positive rate  
>> with
>> the trailing space should be almost zero, and the people using a
>> coding style that puts spaces around operators keep the benefit of  
>> the
>> warning.
>
> That is a great suggestion, implemented!
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090302/013618.html
>
> -Chris





More information about the cfe-dev mailing list