Add more warning options to BUILD_FOR_OPENEULER gcc compatible part 2.
Signed-off-by: liyunfei <liyunfei33@huawei.com>
This commit is contained in:
parent
2a610e3299
commit
59d3f9de0c
@ -11,7 +11,7 @@ diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains
|
||||
index 793af55a1e5f..f0da323d8adb 100644
|
||||
--- a/clang/lib/Driver/ToolChains/Clang.cpp
|
||||
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
|
||||
@@ -4683,11 +4683,31 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
@@ -4683,11 +4683,37 @@ 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)) {
|
||||
@ -26,6 +26,11 @@ index 793af55a1e5f..f0da323d8adb 100644
|
||||
+ 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()) {
|
||||
@ -40,6 +45,7 @@ index 793af55a1e5f..f0da323d8adb 100644
|
||||
+ //other warnings
|
||||
+ CmdArgs.push_back("-Wno-error=cast-align");
|
||||
+ CmdArgs.push_back("-Wno-error=enum-conversion");
|
||||
+ CmdArgs.push_back("-Wno-error=switch");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
Name: %{pkg_name}
|
||||
Version: %{clang_version}
|
||||
Release: 9
|
||||
Release: 10
|
||||
Summary: A C language family front-end for LLVM
|
||||
|
||||
License: NCSA
|
||||
@ -380,6 +380,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build
|
||||
%{install_bindir}/git-clang-format
|
||||
|
||||
%changelog
|
||||
* Thu Mar 28 2024 liyunfei <liyunfei33@huawei.com> -17.0.6-10
|
||||
- Add more warning options to BUILD_FOR_OPENEULER gcc compatible part 2.
|
||||
|
||||
* Fri Mar 15 2024 liyunfei <liyunfei33@huawei.com> -17.0.6-9
|
||||
- Add more warning options to BUILD_FOR_OPENEULER gcc compatible.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user