]> granicus.if.org Git - clang/commit
For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is available
authorErich Keane <erich.keane@intel.com>
Mon, 11 Dec 2017 17:36:42 +0000 (17:36 +0000)
committerErich Keane <erich.keane@intel.com>
Mon, 11 Dec 2017 17:36:42 +0000 (17:36 +0000)
commit20a630420df42944fa7676747f31973bf2021783
tree31ad66545e599117e0983a26f5b4f9d83a4e6f84
parentf1094b8cc1ca05380b4fad618b7dcfdb113995e8
For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is available

As reported in llvm bugzilla 32377.
Here’s a patch to add preinclude of stdc-predef.h.

The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html;

The preinclude is inhibited with –ffreestanding.

Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior.

I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here

Note: this is a recommit after a test failure took down the original (r318669)

Patch By: mibintc
Differential Revision: https://reviews.llvm.org/D34158

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320391 91177308-0d34-0410-b5e6-96231b3b80d8
24 files changed:
include/clang/Driver/CC1Options.td
include/clang/Lex/PreprocessorOptions.h
lib/Driver/Job.cpp
lib/Driver/ToolChains/Linux.cpp
lib/Driver/ToolChains/Linux.h
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/InitPreprocessor.cpp
test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h [new file with mode: 0644]
test/Driver/crash-report-header.h
test/Driver/crash-report-spaces.c
test/Driver/crash-report.c
test/Driver/rewrite-map-in-diagnostics.c
test/Driver/stdc-predef.c [new file with mode: 0644]
test/Driver/stdc-predef.i [new file with mode: 0644]
test/Index/IBOutletCollection.m
test/Index/annotate-macro-args.m
test/Index/annotate-tokens-pp.c
test/Index/annotate-tokens.c
test/Index/c-index-getCursor-test.m
test/Index/get-cursor-macro-args.m
test/Index/get-cursor.cpp
test/Preprocessor/ignore-pragmas.c
unittests/Tooling/TestVisitor.h
unittests/libclang/LibclangTest.cpp