Refactor Compiler Warning Features, Rewire Bazel Usage, and Refresh Module/Docs#660
Refactor Compiler Warning Features, Rewire Bazel Usage, and Refresh Module/Docs#660AAmbuj wants to merge 7 commits into
Conversation
3c6f242 to
987467b
Compare
| "conversion": ["-Wfloat-conversion"], | ||
| "shadow": ["-Wshadow"], | ||
| "sign_compare": ["-Wsign-compare"], | ||
| "unused_parameter": ["-Wunused-parameter"], |
There was a problem hiding this comment.
removed the unused flag and test cases
| @@ -1,68 +1,156 @@ | |||
| # Compiler Warnings Test | |||
There was a problem hiding this comment.
updated the Redmi in more details
| @@ -100,11 +100,17 @@ score_gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gc | |||
| # score_communication_* cc_features (currently consumed by the LLVM toolchain). | |||
| SCORE_GCC_MINIMAL_WARNING_COMPILE_FLAGS = [ | |||
There was a problem hiding this comment.
more flags were added there for cross-toolchain parity, not to make warnings stricter than intended
987467b to
471ddc6
Compare
| cc_feature( | ||
| name = "minimal_warnings", | ||
| args = [ | ||
| "//quality/compiler_warnings:default_compile_args", |
There was a problem hiding this comment.
Avoid doing this. This can lead to weird command lines if somebody explicitly enables both features. Instead use implies.
There was a problem hiding this comment.
Thanks for the catch. I've updated this to use implies. It cleans up the command-line behavior for concurrent features while keeping the shared flags organized in one place.
| cc_feature( | ||
| name = "minimal_warnings", | ||
| args = [ | ||
| "//quality/compiler_warnings:default_compile_args", |
89c4449 to
b13d762
Compare
|
fix CI PR: #670 |
88fa076 to
8e9c001
Compare
8024ed7 to
755ac5c
Compare
755ac5c to
b07f607
Compare
| cc_feature( | ||
| name = "minimal_warnings", | ||
| args = [ | ||
| ":default_compile_args", |
There was a problem hiding this comment.
This should not be here. You are mixing things.
| name = "copyable_atomic_test", | ||
| srcs = ["copyable_atomic_test.cpp"], | ||
| features = COMPILER_WARNING_FEATURES, | ||
| features = COMPILER_WARNING_FEATURES + ["-score_communication_treat_warnings_as_errors"], |
There was a problem hiding this comment.
Please create a follow-up ticket for this or directly a PR to get rid of this again.
There was a problem hiding this comment.
I all ready created a fix CI PR: #670: but Jan is saying test itself is a self assign so we cant modify.
| llvm.toolchain( | ||
| cxx_standard = {"": "c++17"}, | ||
| extra_enabled_features = [ | ||
| "//quality/compiler_warnings:default_flags", |
There was a problem hiding this comment.
This should stay.
Also ideally move the default flags out of compiler_warnings. They are not about warnings at all. They are the defaults we require to make the compilation sane. Move them to bazel/toolchains/llvm/flags.bzl
b07f607 to
03c8667
Compare
…gn test The self-assignment test intentionally triggers -Wself-assign-overloaded, which is promoted to an error by the score_communication_treat_warnings_as_errors feature. Disable this feature for the copyable_atomic_test target so the intentional self-assignment compiles without failing the build.
03c8667 to
aa5e66b
Compare
Restructures compiler warning feature management and aligns build/test/docs with the new layout.