aaron.ballman added a comment.

In https://reviews.llvm.org/D53817#1279053, @JonasToth wrote:

> > I personally haven't yet seen this check firing on *predefined* macros.
>
> I did specifically check the compiler defined macros I could see in the AST 
> and they were not diagnosed from the beginning.
>  I would guess, only the compiler-flag macros are passed in the PPCallbacks, 
> which would explain the current behaviour.


Thanks for checking; I hadn't had the chance to try it out yet and was making a 
guess.

>> The only problem i have are these command-line-based macros.
>>  They *may* be outside of programmer's control, but if one has access to the 
>> buildsystem
>>  (as in, not *just* to the source code to be compiled, but to the build 
>> system definitions
>>  that say *how* to build it), then one can easily add such 
>> command-line-based macros.
> 
> It is a burden with little to gain as they the toggle-stuff use-case is not 
> replaceable with other constructs.
>  Having it as opt-in might be ok, but by default the check should not 
> diagnose them.

+1; I'd be fine with an opt-in option for the behavior.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53817



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to