[PATCH] D34158: For standards compatibility, preinclude <stdc-predef.h> if the file is available

Blower, Melanie via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 1 05:44:21 PDT 2017


 
joerg added a comment.

I had a long discussion with James about this on IRC without reaching a clear consensus. I consider forcing this behavior on all targets to be a major bug. It should be opt-in and opt-in only:

(1) The header name is not mandated by any standard. It is not in any namespace generally accepted as implementation-owned.
(2) It adds magic behavior that can make debugging more difficult. Partially preprocessed sources for example could be compiled with plain -c before, now they need a different command line.
(3) It seems to me that the GNU userland (and maybe Windows) is the exception to a well integrated tool chain. Most other platforms have a single canonical libc, libm and libpthread implementation and can as such directly define all the relevant macros directly in the driver. Given that many of the macros involved are already reflected by the compiler behavior anyway, they can't be decoupled. I.e. the questionable concept of locale-independent wchar_t is already hard-coded in the front end as soon as any long character literals are used.

As such, please move the command line additions back into the target-specific files for targets that actually want to get this behavior.

>Thank you Joerg.  Initially I had proposed this only for gnu/Linux. I will submit another patch like this.  As far as I know this is the only toolchain with this behavior.  Please clarify if there are other configurations to cover.

Repository:
  rL LLVM

https://reviews.llvm.org/D34158





More information about the cfe-commits mailing list