[cfe-dev] -Warray-bounds seems over-zealous on Clang

Chris Lattner clattner at apple.com
Tue Jul 12 10:29:18 PDT 2011


On Jul 12, 2011, at 9:50 AM, Douglas Gregor wrote:

>> Besides, the chances of Clang actually helpfully diagnosing a problem
>> with the delta between how GCC does -Warray-bounds and how Clang does
>> it are slim - how often are these problems statically detectable? This
>> is C.
> 
> We have empirical evidence that it *does* find bugs, otherwise we wouldn't still have the warning.

Do we have empirical evidence that it finds bugs in arrays with exactly 1 element?  I think we should just disable it in the case that the array has a single element.  This really is a common pattern.

-Chris



More information about the cfe-dev mailing list