[cfe-commits] Patch: Warn on logical operations with constants

Chandler Carruth chandlerc at google.com
Mon May 30 22:53:22 PDT 2011


I went ahead and committed this in r132327 after verifying that it
doesn't trigger any new warnings in LLVM & Clang.

On Sun, May 29, 2011 at 12:30 PM, Richard Trieu <rtrieu at google.com> wrote:
> On Thu, May 26, 2011 at 3:18 AM, Chandler Carruth <chandlerc at google.com>
> wrote:
>>
>> On Fri, May 6, 2011 at 1:38 PM, Richard Trieu <rtrieu at google.com> wrote:
>>>
>>> The old warning that checked for logical operators with constants did not
>>> treat 1 and 0 as it would for other constants.  Changed the warning so that
>>> if a bool type exists, 1 and 0 will trigger the warning.
>>
>> Is there a PR for this? It'd be good to have more motivating examples in
>> the description or something... But you do have one in the Code Review
>> description I see.
>>
>>>
>>> Patch is attached and available through Code Review:
>>> http://codereview.appspot.com/4444068/
>>
>> Some minor comments left on the patch here.
>
> Made the changes that Chandler suggested in Code Review.  Anyone else have
> any comments on this patch?




More information about the cfe-commits mailing list