[cfe-commits] r127425 - /cfe/trunk/lib/Sema/SemaChecking.cpp

John McCall rjmccall at apple.com
Thu Mar 10 19:53:04 PST 2011


On Mar 10, 2011, at 7:11 PM, Ted Kremenek wrote:

> 
> On Mar 10, 2011, at 6:35 PM, Chris Lattner wrote:
> 
>> On Mar 10, 2011, at 1:22 PM, Ted Kremenek wrote:
>> 
>>> The spelling location is checked because the diagnostic gets pruned if:
>>> 
>>> 1) The diagnostic was instantiated from a macro
>>> 
>>> AND
>>> 
>>> 2) That macro was from a system header.
>>> 
>>> #2 is the reason getSpellingLoc() is called.
>> 
>> Right, I get that... but why is this to right policy?
>> 
>> -Chris
> 
> I'm not familiar with the background behind the policy decision.  John made this change back in October.

If a system header has a macro which does unfortunate implicit conversions — and lo! it happens — that's not something we need to tell users about.  However, if a user writes
  char c = INT_MAX;
we should warn about it even though the literal is actually written in a system header.

John.



More information about the cfe-commits mailing list