aaron.ballman added a comment.

In D106577#2902091 <https://reviews.llvm.org/D106577#2902091>, @jyknight wrote:

> In D106577#2901654 <https://reviews.llvm.org/D106577#2901654>, @rsmith wrote:
>
>> I think this patch as it stands would cause problems with libc 
>> implementations that put their `#define` somewhere other than than 
>> `stdc-predef.h` (eg, older versions of glibc that put it in `features.h` or 
>> other standard libraries that put it in `yvals.h`) due to the macro 
>> redefinition with a conflicting expansion. Such implementations are 
>> non-conforming but certainly exist. Likewise it could break the build for 
>> the same reason if we start implicitly including `stdc-predef.h` at some 
>> point. So I think that blindly predefining this macro will prove problematic 
>> in at least some circumstances.
>
> I don't understand what problem you expect to see here. We already suppress 
> -Wmacro-redefined [which this falls under] for system headers -- doesn't that 
> suffice?

I'd like to hear more about this as well, FWIW. I think we get all the benefits 
you describe by defining the macro in the frontend and letting the macro 
suppression work if there's a conflicting definition from a system header.

Btw @cor3ntin, it looks like you've got some failing test cases that need to be 
looked at:

https://reviews.llvm.org/harbormaster/unit/view/898745/
https://reviews.llvm.org/harbormaster/unit/view/898763/


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106577/new/

https://reviews.llvm.org/D106577

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

Reply via email to