-
Notifications
You must be signed in to change notification settings - Fork 86
Refactor Compiler Warning Features, Rewire Bazel Usage, and Refresh Module/Docs #660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
045aca3
d7bdd02
10b83ea
7f128bf
8baa493
e1e23cd
ad20d64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,11 +101,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 = [ | ||
| "-Wall", | ||
| "-W", | ||
| "-Wno-error=deprecated-declarations", | ||
| "-Wno-error=cpp", | ||
| "-Wno-builtin-macro-redefined", | ||
| "-Wno-deprecated-non-prototype", | ||
| "-Wno-format-y2k", | ||
| "-Wno-free-nonheap-object", | ||
| "-Wno-maybe-uninitialized", | ||
| "-Wno-unused-macros", | ||
| "-Wno-unused-parameter", | ||
| "-Wno-unused-variable", | ||
| "-Wunused-but-set-parameter", | ||
| ] | ||
|
|
||
|
|
@@ -279,7 +285,7 @@ llvm = use_extension( | |
| llvm.toolchain( | ||
| cxx_standard = {"": "c++17"}, | ||
| extra_enabled_features = [ | ||
| "//quality/compiler_warnings:default_flags", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should stay.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed! |
||
| "//quality/compiler_warnings:default_compile_flags", | ||
| "//quality/compiler_warnings:default_link_flags", | ||
| "//quality/compiler_warnings/clang:minimal_warnings", | ||
| ], | ||
|
|
@@ -289,6 +295,8 @@ llvm.toolchain( | |
| "@score_cpp_policies//sanitizers/features:ubsan", | ||
| "@score_cpp_policies//sanitizers/features:lsan", | ||
| "@score_cpp_policies//sanitizers/features:tsan", | ||
| "//quality/compiler_warnings:minimal_warnings", | ||
| "//quality/compiler_warnings:strict_warnings", | ||
| "//quality/compiler_warnings:treat_warnings_as_errors", | ||
| "//quality/compiler_warnings:additional_warnings", | ||
| "//quality/compiler_warnings/clang:strict_warnings", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,16 +14,14 @@ | |
| load("@bazel_skylib//rules:build_test.bzl", "build_test") | ||
| load("@rules_build_error//lang/cc:defs.bzl", "cc_build_error_test") | ||
| load("@rules_build_error//matcher:defs.bzl", "matcher") | ||
| load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") | ||
| load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") | ||
|
|
||
| # Compiler warning feature tests. | ||
| WARNING_FLAGS_BY_CASE = { | ||
| "conversion": ["-Wfloat-conversion"], | ||
| "shadow": ["-Wshadow"], | ||
| "sign_compare": ["-Wsign-compare"], | ||
| "unused_parameter": ["-Wunused-parameter"], | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed the unused flag and test cases |
||
| "cast_qual": ["-Wcast-qual"], | ||
| "format_nonliteral": ["-Wformat-nonliteral"], | ||
| "undef": ["-Wundef"], | ||
| "delete_non_virtual_dtor": ["-Wdelete-non-virtual-dtor"], | ||
| "overloaded_virtual": ["-Woverloaded-virtual"], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more flags were added there for cross-toolchain parity, not to make warnings stricter than intended