代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/clang 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 929e5c1d4f2c36e233a26b480f1dd172b6d63362 Mon Sep 17 00:00:00 2001
From: liyunfei <liyunfei33@huawei.com>
Date: Thu, 14 Mar 2024 16:04:40 +0800
Subject: [PATCH] add more warning options to -fgcc-compatible
---
clang/lib/Driver/ToolChains/Clang.cpp | 20 ++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 793af55a1e5f..f0da323d8adb 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4683,11 +4683,42 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
#ifdef BUILD_FOR_OPENEULER
if (Args.hasFlag(options::OPT_fgcc_compatible,
options::OPT_fno_gcc_compatible, false)) {
+ // compatibility relevent warnings
CmdArgs.push_back("-Wno-error=unknown-warning-option");
+ CmdArgs.push_back("-Wno-error=ignored-attributes");
+ // By default, clang reports warnings, but gcc does not.
CmdArgs.push_back("-Wno-error=unused-parameter");
CmdArgs.push_back("-Wno-error=unused-function");
CmdArgs.push_back("-Wno-error=unused-but-set-parameter");
CmdArgs.push_back("-Wno-error=unused-but-set-variable");
+ CmdArgs.push_back("-Wno-error=deprecated-non-prototype");
+ CmdArgs.push_back("-Wno-error=unsafe-buffer-usage");
+ CmdArgs.push_back("-Wno-error=string-plus-int");
+ CmdArgs.push_back("-Wno-error=language-extension-token");
+ CmdArgs.push_back("-Wno-error=single-bit-bitfield-constant-conversion");
+ CmdArgs.push_back("-Wno-error=gnu-variable-sized-type-not-at-end");
+ CmdArgs.push_back("-Wno-error=header-guard");
+ CmdArgs.push_back("-Wno-error=return-type-c-linkage");
+ // By default, clang reports errors, but gcc reports warnings.
+ // when -Werror is passed don't add -Wno-error=*.
+ if(!D.getDiags().getWarningsAsErrors()) {
+ CmdArgs.push_back("-Wno-error=implicit-function-declaration");
+ CmdArgs.push_back("-Wno-error=incompatible-function-pointer-types");
+ CmdArgs.push_back("-Wno-error=register");
+ CmdArgs.push_back("-Wno-error=int-conversion");
+ CmdArgs.push_back("-Wno-error=implicit-int");
+ CmdArgs.push_back("-Wno-error=enum-constexpr-conversion");
+ CmdArgs.push_back("-Wno-error=return-type");
+ CmdArgs.push_back("-Wno-error=reserved-user-defined-literal");
+ }
+ //other warnings
+ CmdArgs.push_back("-Wno-error=cast-align");
+ CmdArgs.push_back("-Wno-error=enum-conversion");
+ CmdArgs.push_back("-Wno-error=switch");
+ CmdArgs.push_back("-Wno-error=cast-qual");
+ CmdArgs.push_back("-Wno-error=varargs");
+ CmdArgs.push_back("-Wno-error=unused-value");
+ CmdArgs.push_back("-Wno-error=format-nonliteral");
}
#endif
--
2.42.0.windows.2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。