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

Fedor Sergeev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 27 15:59:02 PDT 2017


fedor.sergeev added a comment.

Hmm... I tried this patch and now the following worries me:

- it passes -finclude-if-exists stdc-predef.h on all platforms (say, including my Solaris platform that has no system stdc-predef.h)
- it searches all the paths, not just "system include" ones

That essentially disallows user to have stdc-predef.h include in my own project, since there is a chance that this user header
will be accidentally included by this hidden machinery.

  ] cat stdc-predef.h
  #error I was not expecting to see that
  ] bin/clang hello-world.c
  In file included from <built-in>:2:
  ./stdc-predef.h:1:2: error: I was not expecting to see this!
  #error I was not expecting to see this!
   ^
  1 error generated.
  ]


Repository:
  rL LLVM

https://reviews.llvm.org/D34158





More information about the cfe-commits mailing list