diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-10-20 23:26:58 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-10-20 23:26:58 +0000 |
commit | ab506adf7d3ced6abcaf42f92de3d6cd15fa19e8 (patch) | |
tree | 58e29f07d41e8ad46b8e282367d45b8dbf207a37 /clang/lib | |
parent | e6b994eb93b6825d396e8ee66e791611ba112d25 (diff) | |
download | bcm5719-llvm-ab506adf7d3ced6abcaf42f92de3d6cd15fa19e8.tar.gz bcm5719-llvm-ab506adf7d3ced6abcaf42f92de3d6cd15fa19e8.zip |
Switch C compilations to C11 by default.
This is long-since overdue, and matches GCC 5.0. This should also be
backwards-compatible, because we already supported all of C11 as an extension
in C99 mode.
llvm-svn: 220244
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 2798601a51f..957448a2d49 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -531,8 +531,8 @@ protected: // Solaris headers require _XOPEN_SOURCE to be set to 600 for C99 and // newer, but to 500 for everything else. feature_test.h has a check to // ensure that you are not using C99 with an old version of X/Open or C89 - // with a new version. - if (Opts.C99 || Opts.C11) + // with a new version. + if (Opts.C99) Builder.defineMacro("_XOPEN_SOURCE", "600"); else Builder.defineMacro("_XOPEN_SOURCE", "500"); @@ -4584,7 +4584,7 @@ public: if (Opts.FastMath || Opts.FiniteMathOnly) Builder.defineMacro("__ARM_FP_FAST"); - if ((Opts.C99 || Opts.C11) && !Opts.Freestanding) + if (Opts.C99 && !Opts.Freestanding) Builder.defineMacro("__ARM_FP_FENV_ROUNDING"); Builder.defineMacro("__ARM_SIZEOF_WCHAR_T", Opts.ShortWChar ? "2" : "4"); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 19eecdbaedf..373842d2381 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1129,7 +1129,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, case IK_PreprocessedC: case IK_ObjC: case IK_PreprocessedObjC: - LangStd = LangStandard::lang_gnu99; + LangStd = LangStandard::lang_gnu11; break; case IK_CXX: case IK_PreprocessedCXX: |