Skip to content

Commit 14fc907

Browse files
committed
Only use -fgnuc-version=4.2.1 when parsing C headers with Clang
1 parent 118f901 commit 14fc907

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/driver/driver.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ static int buildPackage(llvm::StringRef packageRoot, const char* argv0) {
535535
}
536536

537537
static void addPlatformCompileOptions() {
538-
cflags.push_back("-fgnuc-version=4.2.1");
539538
#ifdef _WIN32
540539
defines.push_back("Windows");
541540
cflags.push_back("-fms-extensions");

src/sema/c-import.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ bool cx::importCHeader(SourceFile& importer, llvm::StringRef headerName, const C
359359
ci.createDiagnostics(*llvm::vfs::getRealFileSystem(), diagClient);
360360

361361
auto args = map(options.cflags, [](auto& cflag) { return cflag.c_str(); });
362+
args.push_back("-fgnuc-version=4.2.1");
362363
clang::CompilerInvocation::CreateFromArgs(ci.getInvocation(), args, ci.getDiagnostics());
363364

364365
auto pto = std::make_shared<clang::TargetOptions>();

0 commit comments

Comments
 (0)