diff --git a/MODULE.bazel b/MODULE.bazel index 8748511e7..d21d5e103 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -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", + "//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", diff --git a/quality/compiler_warnings/BUILD b/quality/compiler_warnings/BUILD index ec8bba9c9..cb036a73d 100644 --- a/quality/compiler_warnings/BUILD +++ b/quality/compiler_warnings/BUILD @@ -31,14 +31,15 @@ cc_args( "-fno-omit-frame-pointer", "-fcolor-diagnostics", ], + visibility = ["//quality/compiler_warnings:__subpackages__"], ) cc_feature( - name = "default_flags", + name = "default_compile_flags", args = [ ":default_compile_args", ], - feature_name = "score_communication_default_flags", + feature_name = "score_communication_default_compile_flags", visibility = ["//visibility:public"], ) @@ -92,10 +93,22 @@ cc_args( # Keep #warning visible without failing the build. "-Wno-error=cpp", "-Wno-error=deprecated-declarations", + "-Wno-unused-macros", + "-Wno-unused-parameter", + "-Wno-unused-variable", ], visibility = ["//quality/compiler_warnings:__subpackages__"], ) +cc_feature( + name = "minimal_warnings", + args = [ + ":minimal_warnings_args", + ], + feature_name = "score_communication_common_minimal_warnings", + visibility = ["//visibility:public"], +) + cc_args( name = "strict_warnings_args", actions = [ @@ -103,13 +116,21 @@ cc_args( ], args = [ "-Wextra", - "-Wpedantic", "-Wconversion", "-Wsign-conversion", ], visibility = ["//quality/compiler_warnings:__subpackages__"], ) +cc_feature( + name = "strict_warnings", + args = [ + ":strict_warnings_args", + ], + feature_name = "score_communication_common_strict_warnings", + visibility = ["//visibility:public"], +) + cc_args( name = "additional_warnings_args", actions = [ @@ -118,9 +139,6 @@ cc_args( args = [ "-Wcast-align", "-Wcast-qual", - "-Wdouble-promotion", - "-Wformat-nonliteral", - "-Wpointer-arith", "-Wredundant-decls", "-Wundef", "-Wwrite-strings", @@ -134,5 +152,6 @@ cc_feature( ":additional_warnings_args", ], feature_name = "score_communication_additional_warnings", + implies = [":strict_warnings"], visibility = ["//visibility:public"], ) diff --git a/quality/compiler_warnings/clang/BUILD b/quality/compiler_warnings/clang/BUILD index 8f7c689bb..a3181e474 100644 --- a/quality/compiler_warnings/clang/BUILD +++ b/quality/compiler_warnings/clang/BUILD @@ -25,17 +25,18 @@ cc_args( args = [ # Suppress false positive from Clang's self-assignment overloaded check. # See https://bugs.llvm.org/show_bug.cgi?id=43124 - "-Wno-error=self-assign-overloaded", + "-Wno-return-type-c-linkage", + "-Wno-unused-command-line-argument", ], ) cc_feature( name = "minimal_warnings", args = [ - "//quality/compiler_warnings:minimal_warnings_args", ":minimal_warnings_args", ], feature_name = "score_communication_minimal_warnings", + implies = ["//quality/compiler_warnings:minimal_warnings"], visibility = ["//visibility:public"], ) @@ -45,9 +46,7 @@ cc_args( "@rules_cc//cc/toolchains/actions:compile_actions", ], args = [ - "-Wfloat-equal", "-Wformat-security", - "-Wshadow-all", # Demote shadow-uncaptured-local from error to warning. This diagnostic # fires for code in external headers (e.g. score_baselibs simple_task.h) # which we cannot fix. @@ -60,11 +59,13 @@ cc_args( cc_feature( name = "strict_warnings", args = [ - "//quality/compiler_warnings:strict_warnings_args", ":strict_warnings_args", ], feature_name = "score_communication_strict_warnings", - implies = ["minimal_warnings"], + implies = [ + "//quality/compiler_warnings:strict_warnings", + "minimal_warnings", + ], visibility = ["//visibility:public"], ) @@ -74,7 +75,14 @@ cc_args( "@rules_cc//cc/toolchains/actions:compile_actions", ], args = [ - "-Wno-error", + "-Wno-error=conversion", + "-Wno-error=return-type", + "-Wno-error=shadow", + "-Wno-error=sign-compare", + "-Wno-error=sign-conversion", + "-Wno-error=strict-aliasing", + "-Wno-error=unknown-warning-option", + "-Wno-error=unused-function", ], ) @@ -93,12 +101,7 @@ cc_args( actions = [ "@rules_cc//cc/toolchains/actions:compile_actions", ], - args = [ - "--no-warnings", - # Keep default-error diagnostics non-fatal in third-party code. - "-Wno-error=implicit-function-declaration", - "-Wno-error=missing-template-arg-list-after-template-kw", - ], + args = ["-w"], ) cc_feature( diff --git a/quality/compiler_warnings/gcc/BUILD b/quality/compiler_warnings/gcc/BUILD index 3290da691..8a726e774 100644 --- a/quality/compiler_warnings/gcc/BUILD +++ b/quality/compiler_warnings/gcc/BUILD @@ -22,6 +22,9 @@ cc_args( "@rules_cc//cc/toolchains/actions:compile_actions", ], args = [ + "-W", + "-Wno-builtin-macro-redefined", + "-Wno-deprecated-non-prototype", "-Wno-format-y2k", "-Wno-free-nonheap-object", # Reduce known GCC false positives. @@ -44,11 +47,11 @@ cc_args( cc_feature( name = "minimal_warnings", args = [ - "//quality/compiler_warnings:minimal_warnings_args", ":minimal_warnings_args_for_all_compile_actions", ":minimal_warnings_args_for_cpp_compile_actions", ], feature_name = "score_communication_minimal_warnings", + implies = ["//quality/compiler_warnings:minimal_warnings"], visibility = ["//visibility:public"], ) @@ -59,8 +62,6 @@ cc_args( ], args = [ "-Warray-bounds=2", - "-Wcast-align", - "-Wcast-qual", "-Wdisabled-optimization", "-Wfloat-conversion", "-Wformat=2", @@ -71,12 +72,9 @@ cc_args( "-Wpacked", "-Wscalar-storage-order", "-Wsuggest-attribute=format", - "-Wundef", "-Wunused-macros", "-Wvector-operation-performance", - "-Wwrite-strings", "-Wlogical-op", - "-Wredundant-decls", "-Wshadow", ], ) @@ -108,13 +106,15 @@ cc_args( cc_feature( name = "strict_warnings", args = [ - "//quality/compiler_warnings:strict_warnings_args", ":strict_warnings_args_for_all_compile_actions", ":strict_warnings_args_for_cpp_compile_actions", ":strict_warnings_args_for_c_compile_actions", ], feature_name = "score_communication_strict_warnings", - implies = ["minimal_warnings"], + implies = [ + "//quality/compiler_warnings:strict_warnings", + "minimal_warnings", + ], visibility = ["//visibility:public"], ) @@ -126,6 +126,32 @@ cc_args( args = [ # Must come after -Werror so it takes effect. "-Wno-error", + "-Wno-error=address-of-packed-member", + "-Wno-error=alloc-size-larger-than=", + "-Wno-error=array-bounds", + "-Wno-error=attributes", + "-Wno-error=conversion", + "-Wno-error=dangling-pointer=2", + "-Wno-error=invalid-memory-model", + "-Wno-error=maybe-uninitialized", + "-Wno-error=misleading-indentation", + "-Wno-error=missing-attributes", + "-Wno-error=nonnull", + "-Wno-error=pessimizing-move", + "-Wno-error=range-loop-construct", + "-Wno-error=redundant-move", + "-Wno-error=return-type", + "-Wno-error=shadow", + "-Wno-error=sign-compare", + "-Wno-error=sign-conversion", + "-Wno-error=stringop-overflow=2", + "-Wno-error=stringop-truncation", + "-Wno-error=strict-aliasing", + "-Wno-error=tsan", + "-Wno-error=type-limits", + "-Wno-error=uninitialized", + "-Wno-error=unused-but-set-variable", + "-Wno-error=unused-function", ], ) diff --git a/quality/compiler_warnings/test/BUILD b/quality/compiler_warnings/test/BUILD index 65000ca90..61dbf30b0 100644 --- a/quality/compiler_warnings/test/BUILD +++ b/quality/compiler_warnings/test/BUILD @@ -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"], "cast_qual": ["-Wcast-qual"], - "format_nonliteral": ["-Wformat-nonliteral"], "undef": ["-Wundef"], "delete_non_virtual_dtor": ["-Wdelete-non-virtual-dtor"], "overloaded_virtual": ["-Woverloaded-virtual"], diff --git a/quality/compiler_warnings/test/README.md b/quality/compiler_warnings/test/README.md index 099e287f6..cbb2f4e3e 100644 --- a/quality/compiler_warnings/test/README.md +++ b/quality/compiler_warnings/test/README.md @@ -1,68 +1,158 @@ -# Compiler Warnings Test +# Compiler Warnings -Verifies that warning features work correctly using two complementary test cases. +This directory defines the compiler warning feature set for the `score_communication` project +and verifies that each warning flag is correctly wired up in the Bazel toolchain. -## Test Strategy +## Overview -| Case | Target | Features | Code | Expected result | -|------|--------|----------|------|-----------------| -| 1 | `tp_build_test` | `treat_warnings_as_errors` disabled | `has_warnings/.cpp` — one bug per flag | ✅ compiles (warnings visible, not fatal) | -| 2 | `fp_build_test` | all enabled (via `COMPILER_WARNING_FEATURES`) | `clean.cpp` — no bugs | ✅ compiles | -| 3 | `warnings_negative_test` | `-Werror` + per-flag warning option | `has_warnings/.cpp` — one bug per flag | ❌ build fails | +Warning flags are grouped into named `cc_feature` targets that consumers apply via the +`features` attribute of any `cc_binary`, `cc_library`, or `cc_test` rule. Features are +layered: each level implies all levels below it. -Each warning flag has its own source file and its own bazel target (`tp_`) -so every flag is exercised independently. A single combined target would only -surface the first flag that triggers, hiding the rest. +``` +score_communication_minimal_warnings + └─ score_communication_strict_warnings + └─ score_communication_additional_warnings +``` -## Files +`score_communication_treat_warnings_as_errors` (`-Werror`) is a separate orthogonal feature +that can be combined with any of the above. -| File | Purpose | -|------|---------| -| [`no_warnings/clean.cpp`](no_warnings/clean.cpp) | False-positive baseline — must compile with all warning features enabled | -| [`has_warnings/`](has_warnings) | True-positive baseline — one source file per warning flag | -| [`BUILD`](BUILD) | Defines `fp_all`/`fp_build_test`, per-flag `tp_`/`tp_build_test`, and per-flag `fail__build_error_test` targets | +`score_communication_third_party_warnings` is mutually exclusive with all other warning +features and is intended for external code that cannot be modified. -## Running the Tests +`score_communication_strict_warnings_no_error` is a convenience variant of strict warnings +that demotes selected diagnostics from errors to warnings — useful during incremental +adoption of stricter flags. -```bash -bazel test //quality/compiler_warnings/test:tp_build_test +## Feature Reference -bazel test //quality/compiler_warnings/test:fp_build_test +### Common flags ([`//quality/compiler_warnings:…`](../BUILD)) + +Shared base args consumed by both GCC and Clang features. + +| `cc_args` target | Flags | +|-----------------|-------| +| `default_compile_args` | `-march=nehalem`, `-ffp-model=strict`, `-U_FORTIFY_SOURCE`, `-fstack-protector`, `-fno-omit-frame-pointer`, `-fcolor-diagnostics` | +| `default_link_args` | `-lrt`, `-latomic` | +| `minimal_warnings_args` | `-Wall`, `-Wno-error=cpp`, `-Wno-error=deprecated-declarations`, `-Wno-unused-macros`, `-Wno-unused-parameter`, `-Wno-unused-variable` | +| `strict_warnings_args` | `-Wextra`, `-Wconversion`, `-Wsign-conversion` | +| `additional_warnings_args` | `-Wcast-align`, `-Wcast-qual`, `-Wredundant-decls`, `-Wundef`, `-Wwrite-strings` | +| `treat_warnings_as_errors_args` | `-Werror` | + +### GCC-specific flags ([`//quality/compiler_warnings/gcc:…`](../gcc/BUILD)) + +Additional flags applied only when the GCC toolchain is active. + +| Feature | Extra flags | +|---------|-------------| +| `minimal_warnings` | `-W`, `-Wno-builtin-macro-redefined`, `-Wno-format-y2k`, `-Wno-free-nonheap-object`, `-Wno-maybe-uninitialized`, `-Wunused-but-set-parameter`; C++ only: `-Wno-literal-suffix`, `-Wno-noexcept-type` | +| `strict_warnings` | `-Warray-bounds=2`, `-Wdisabled-optimization`, `-Wfloat-conversion`, `-Wformat=2`, `-Wimplicit-fallthrough=4`, `-Wshadow`, `-Wlogical-op`, and more; C++ only: `-Wdelete-non-virtual-dtor`, `-Woverloaded-virtual`, `-Wregister`, `-Wstrict-null-sentinel`; C only: `-Wold-style-definition`, `-Wstrict-prototypes` | +| `strict_warnings_no_error` | All of `strict_warnings` + `-Wno-error` suppressors for known GCC false positives (conversion, shadow, sign-compare, return-type, etc.) | +| `third_party_warnings` | `-w` (suppress all warnings) | + +### Clang-specific flags ([`//quality/compiler_warnings/clang:…`](../clang/BUILD)) + +Additional flags applied only when the LLVM/Clang toolchain is active. + +| Feature | Extra flags | +|---------|-------------| +| `minimal_warnings` | `-Wno-return-type-c-linkage`, `-Wno-unused-command-line-argument` | +| `strict_warnings` | `-Wformat-security`, `-Wno-error=shadow-uncaptured-local` (demoted — see [score_baselibs#304](https://github.com/eclipse-score/baselibs/issues/304)) | +| `strict_warnings_no_error` | All of `strict_warnings` + `-Wno-error` suppressors for known Clang false positives (conversion, shadow, sign-compare, return-type, etc.) | +| `third_party_warnings` | (no extra flags beyond mutual-exclusion) | + +## Using Warning Features in BUILD Files + +```python +cc_library( + name = "my_lib", + srcs = ["my_lib.cpp"], + hdrs = ["my_lib.h"], + features = [ + "score_communication_strict_warnings", + "score_communication_treat_warnings_as_errors", + ], +) +``` + +The full recommended set for production targets is available via the `COMPILER_WARNING_FEATURES` +constant defined in [`score/common_features.bzl`](../../../score/common_features.bzl): -bazel test //quality/compiler_warnings/test:fp_build_test //quality/compiler_warnings/test:tp_build_test +```python +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") -bazel test //quality/compiler_warnings/test:warnings_negative_test --test_output=all +cc_library( + name = "my_lib", + srcs = ["my_lib.cpp"], + features = COMPILER_WARNING_FEATURES, +) ``` > **Note:** `cc_feature` targets only work with the **LLVM toolchain**. The default GCC toolchain -> ignores them. To exercise features with LLVM: +> does not support them. To test features with LLVM explicitly: ```bash -bazel test //quality/compiler_warnings/test:fp_build_test \ +bazel build //... \ --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux ``` -## Warning Coverage +--- + +## Tests (`test/`) + +The test suite verifies that every warning flag is correctly wired: flags that should +trigger do trigger, and clean code compiles without false positives. + +### Test Strategy + +| Case | Bazel target | Setup | Expected outcome | +|------|-------------|-------|-----------------| +| **True-positive build** | `tp_build_test` | Per-flag `has_warnings/.cpp` with `treat_warnings_as_errors` disabled | Compiles successfully — warnings are visible but not fatal | +| **False-positive build** | `fp_build_test` | `no_warnings/clean.cpp` with all `COMPILER_WARNING_FEATURES` enabled | Compiles successfully — no spurious warnings | +| **Negative (must-fail)** | `warnings_negative_test` | Per-flag `has_warnings/.cpp` compiled with `-Werror` + the specific flag | Build fails with the expected `-Werror=` diagnostic | + +Each warning flag has its own source file and its own Bazel target so that every flag +is exercised independently. A single combined target would only surface the first +triggering flag and hide the rest. + +### Test Files + +| Path | Purpose | +|------|---------| +| [`no_warnings/clean.cpp`](no_warnings/clean.cpp) | False-positive baseline — clean code that must compile under all warning features | +| [`has_warnings/`](has_warnings/) | True-positive baselines — one `.cpp` per flag, each containing exactly one defect | +| [`BUILD`](BUILD) | Defines all three test families | -### True Positives (`has_warnings/`) +### Warning Coverage -One source file per flag, each triggering exactly one warning category: +| Source file | Warning flag | Bazel feature | MISRA / CWE | +|-------------|-------------|---------------|-------------| +| [has_warnings/conversion.cpp](has_warnings/conversion.cpp) | `-Wfloat-conversion` | `score_communication_strict_warnings` | MISRA Rule 7.0.5, CWE-681 | +| [has_warnings/shadow.cpp](has_warnings/shadow.cpp) | `-Wshadow` | `score_communication_strict_warnings` | MISRA Rule 6.4.1, CWE-398 | +| [has_warnings/sign_compare.cpp](has_warnings/sign_compare.cpp) | `-Wsign-compare` | `score_communication_strict_warnings` | CWE-195, CWE-697 | +| [has_warnings/delete_non_virtual_dtor.cpp](has_warnings/delete_non_virtual_dtor.cpp) | `-Wdelete-non-virtual-dtor` | `score_communication_strict_warnings` (C++) | MISRA Rule 15.7.1 | +| [has_warnings/overloaded_virtual.cpp](has_warnings/overloaded_virtual.cpp) | `-Woverloaded-virtual` | `score_communication_strict_warnings` (C++) | MISRA Rule 10.2.0 | +| [has_warnings/cast_qual.cpp](has_warnings/cast_qual.cpp) | `-Wcast-qual` | `score_communication_additional_warnings` | MISRA Rule 8.2.3 | +| [has_warnings/undef.cpp](has_warnings/undef.cpp) | `-Wundef` | `score_communication_additional_warnings` | MISRA Dir 4.4 | -| Source file | Warning flag | Feature | MISRA / CWE | -|-------------|-------------|---------|-------------| -| `conversion.cpp` | `-Wconversion` / `-Wfloat-conversion` | `score_communication_strict_warnings` | MISRA Rule 7.0.5, CWE-681 | -| `shadow.cpp` | `-Wshadow` | `score_communication_strict_warnings` | MISRA Rule 6.4.1, CWE-398 | -| `sign_compare.cpp` | `-Wsign-compare` | `score_communication_strict_warnings` | CWE-195, CWE-697 | -| `unused_parameter.cpp` | `-Wunused-parameter` | `score_communication_strict_warnings` | MISRA Rule 0.1.1, CWE-561 | -| `delete_non_virtual_dtor.cpp` | `-Wdelete-non-virtual-dtor` | `score_communication_strict_warnings` (C++) | MISRA Rule 15.7.1 | -| `overloaded_virtual.cpp` | `-Woverloaded-virtual` | `score_communication_strict_warnings` (C++) | MISRA Rule 10.2.0 | -| `cast_qual.cpp` | `-Wcast-qual` | `score_communication_additional_warnings` | MISRA Rule 8.2.3 | -| `format_nonliteral.cpp` | `-Wformat-nonliteral` | `score_communication_additional_warnings` | CWE-134 | -| `undef.cpp` | `-Wundef` | `score_communication_additional_warnings` | MISRA Dir 4.4 | +`no_warnings/clean.cpp` demonstrates the correct coding patterns that avoid each of the +above warnings: `static_cast<>`, guarded comparisons, `[[maybe_unused]]`, distinct variable +names, const-safe pointer access, virtual destructors, and `using` declarations. -### False Positives (`clean.cpp`) +### Running the Tests -Demonstrates correct coding patterns that avoid triggering the above warnings: -`static_cast<>`, guarded comparisons, `std::ignore`, `[[maybe_unused]]`, -distinct variable names, const-safe access, literal format strings, defined macros, -virtual destructors, and `using` declarations. +```bash +# Verify that warning code compiles when -Werror is disabled (true-positive build test). +bazel test //quality/compiler_warnings/test:tp_build_test + +# Verify that clean code compiles with all warning features enabled (false-positive build test). +bazel test //quality/compiler_warnings/test:fp_build_test + +# Run both build tests together. +bazel test //quality/compiler_warnings/test:fp_build_test \ + //quality/compiler_warnings/test:tp_build_test + +# Verify that warning code fails to build with -Werror (negative / must-fail tests). +bazel test //quality/compiler_warnings/test:warnings_negative_test --test_output=errors +``` diff --git a/quality/compiler_warnings/test/has_warnings/format_nonliteral.cpp b/quality/compiler_warnings/test/has_warnings/format_nonliteral.cpp deleted file mode 100644 index 21e2f4e87..000000000 --- a/quality/compiler_warnings/test/has_warnings/format_nonliteral.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// ******************************************************************************* -// Copyright (c) 2025 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache License Version 2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: Apache-2.0 -// ******************************************************************************* - -/// @file format_nonliteral.cpp -/// @brief Triggers warning: -Wformat-nonliteral. - -#include -#include - -namespace compiler_warnings_test -{ - -void format_nonliteral(const char* fmt, std::int32_t value) -{ - std::printf(fmt, value); -} - -} // namespace compiler_warnings_test diff --git a/quality/compiler_warnings/test/has_warnings/unused_parameter.cpp b/quality/compiler_warnings/test/has_warnings/unused_parameter.cpp deleted file mode 100644 index 43a6ff37d..000000000 --- a/quality/compiler_warnings/test/has_warnings/unused_parameter.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// ******************************************************************************* -// Copyright (c) 2025 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache License Version 2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: Apache-2.0 -// ******************************************************************************* - -/// @file unused_parameter.cpp -/// @brief Triggers warning: -Wunused-parameter. - -#include - -namespace compiler_warnings_test -{ - -std::int32_t unused_parameter(std::int32_t input, std::int32_t unused_param) -{ - return input * 2; -} - -} // namespace compiler_warnings_test diff --git a/quality/quality.md b/quality/quality.md index 2d820abd7..352c974dc 100644 --- a/quality/quality.md +++ b/quality/quality.md @@ -201,16 +201,16 @@ bazel test --config=tsan //... ## Compiler Warnings -Compiler warning features are defined in [`quality/compiler_warnings/`](compiler_warnings/) and referenced in targets through the shared bundle in [`score/mw/common_features.bzl`](../score/mw/common_features.bzl). Warning features are prefixed with `score_communication_` to avoid collisions with other modules. +Compiler warning features are defined in [`quality/compiler_warnings/`](compiler_warnings/) and referenced in targets through the shared bundle in [`score/common_features.bzl`](../score/common_features.bzl). Warning features are prefixed with `score_communication_` to avoid collisions with other modules. -Features are enabled per-target via the `features` attribute. The LLVM toolchain enables `score_communication_default_flags` and `score_communication_minimal_warnings` by default (see [`MODULE.bazel`](../MODULE.bazel)). +Features are enabled per-target via the `features` attribute. The LLVM toolchain enables `score_communication_minimal_warnings` by default (see [`MODULE.bazel`](../MODULE.bazel)). ### Adding Warning Features to a Target Load the shared bundle and set it in your `cc_library` or `cc_unit_test`: ```starlark -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "my_lib", diff --git a/score/mw/common_features.bzl b/score/common_features.bzl similarity index 100% rename from score/mw/common_features.bzl rename to score/common_features.bzl diff --git a/score/message_passing/BUILD b/score/message_passing/BUILD index 08b88f7d7..9eef8e98d 100644 --- a/score/message_passing/BUILD +++ b/score/message_passing/BUILD @@ -14,8 +14,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library") load("@score_baselibs//third_party/itf:py_unittest_qnx_test.bzl", "py_unittest_qnx_test") load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "unit") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") py_unittest_qnx_test( name = "unit_tests_qnx", diff --git a/score/message_passing/log/BUILD b/score/message_passing/log/BUILD index 39db0c555..32b11366e 100644 --- a/score/message_passing/log/BUILD +++ b/score/message_passing/log/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "log", diff --git a/score/message_passing/non_allocating_future/BUILD b/score/message_passing/non_allocating_future/BUILD index 0a26375ce..3509472c0 100644 --- a/score/message_passing/non_allocating_future/BUILD +++ b/score/message_passing/non_allocating_future/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "non_allocating_future", diff --git a/score/mw/com/BUILD b/score/mw/com/BUILD index 3c318d896..e1743702c 100644 --- a/score/mw/com/BUILD +++ b/score/mw/com/BUILD @@ -13,8 +13,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") # Capture README.md for Sphinx documentation at convenient location sphinx_docs_library( diff --git a/score/mw/com/gateway/gateway_application/BUILD b/score/mw/com/gateway/gateway_application/BUILD index 6b4951408..695b41115 100644 --- a/score/mw/com/gateway/gateway_application/BUILD +++ b/score/mw/com/gateway/gateway_application/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") package( default_visibility = ["//score/mw/com/gateway:__subpackages__"], diff --git a/score/mw/com/gateway/gateway_application/configuration/BUILD b/score/mw/com/gateway/gateway_application/configuration/BUILD index 6308945e8..c423d0300 100644 --- a/score/mw/com/gateway/gateway_application/configuration/BUILD +++ b/score/mw/com/gateway/gateway_application/configuration/BUILD @@ -12,9 +12,9 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//bazel/tools:json_schema_validator.bzl", "validate_json_schema_test") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") package( default_visibility = ["//score/mw/com/gateway:__subpackages__"], diff --git a/score/mw/com/gateway/transport_layer/BUILD b/score/mw/com/gateway/transport_layer/BUILD index bccb1859b..51c91a579 100644 --- a/score/mw/com/gateway/transport_layer/BUILD +++ b/score/mw/com/gateway/transport_layer/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") package( default_visibility = ["//score/mw/com/gateway:__subpackages__"], diff --git a/score/mw/com/gateway/transport_layer/sample/configuration/BUILD b/score/mw/com/gateway/transport_layer/sample/configuration/BUILD index 8afa6f8da..634868f24 100644 --- a/score/mw/com/gateway/transport_layer/sample/configuration/BUILD +++ b/score/mw/com/gateway/transport_layer/sample/configuration/BUILD @@ -12,9 +12,9 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//bazel/tools:json_schema_validator.bzl", "validate_json_schema_test") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") package( default_visibility = ["//score/mw/com/gateway:__subpackages__"], diff --git a/score/mw/com/impl/BUILD b/score/mw/com/impl/BUILD index 907c51a7f..618765358 100644 --- a/score/mw/com/impl/BUILD +++ b/score/mw/com/impl/BUILD @@ -13,8 +13,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "component", "unit") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") component( name = "frontend_component", diff --git a/score/mw/com/impl/bindings/lola/BUILD b/score/mw/com/impl/bindings/lola/BUILD index da85d38ef..6c3c72da5 100644 --- a/score/mw/com/impl/bindings/lola/BUILD +++ b/score/mw/com/impl/bindings/lola/BUILD @@ -13,8 +13,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "component", "unit") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") component( name = "lola_component", diff --git a/score/mw/com/impl/bindings/lola/messaging/BUILD b/score/mw/com/impl/bindings/lola/messaging/BUILD index cdd3b10e0..5f4d90a96 100644 --- a/score/mw/com/impl/bindings/lola/messaging/BUILD +++ b/score/mw/com/impl/bindings/lola/messaging/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "asil_specific_cfg", diff --git a/score/mw/com/impl/bindings/lola/methods/BUILD b/score/mw/com/impl/bindings/lola/methods/BUILD index bebd75555..2680e0110 100644 --- a/score/mw/com/impl/bindings/lola/methods/BUILD +++ b/score/mw/com/impl/bindings/lola/methods/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "proxy_method_instance_identifier", diff --git a/score/mw/com/impl/bindings/lola/service_discovery/BUILD b/score/mw/com/impl/bindings/lola/service_discovery/BUILD index 6f3333d73..6bdad57a6 100644 --- a/score/mw/com/impl/bindings/lola/service_discovery/BUILD +++ b/score/mw/com/impl/bindings/lola/service_discovery/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") package(default_visibility = [ "//score/mw/com/impl/bindings/lola/service_discovery:__subpackages__", diff --git a/score/mw/com/impl/bindings/lola/service_discovery/client/BUILD b/score/mw/com/impl/bindings/lola/service_discovery/client/BUILD index 6c279c99c..19f0a6667 100644 --- a/score/mw/com/impl/bindings/lola/service_discovery/client/BUILD +++ b/score/mw/com/impl/bindings/lola/service_discovery/client/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "service_discovery_client", diff --git a/score/mw/com/impl/bindings/lola/service_discovery/test/BUILD b/score/mw/com/impl/bindings/lola/service_discovery/test/BUILD index 515866cde..10c1a6e5c 100644 --- a/score/mw/com/impl/bindings/lola/service_discovery/test/BUILD +++ b/score/mw/com/impl/bindings/lola/service_discovery/test/BUILD @@ -12,7 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "service_discovery_client_test_resources", diff --git a/score/mw/com/impl/bindings/lola/test/BUILD b/score/mw/com/impl/bindings/lola/test/BUILD index fcbdc73ab..fee307cd9 100644 --- a/score/mw/com/impl/bindings/lola/test/BUILD +++ b/score/mw/com/impl/bindings/lola/test/BUILD @@ -12,7 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "proxy_event_test_resources", diff --git a/score/mw/com/impl/bindings/lola/test_doubles/BUILD b/score/mw/com/impl/bindings/lola/test_doubles/BUILD index ca816a94d..fb3ac6d56 100644 --- a/score/mw/com/impl/bindings/lola/test_doubles/BUILD +++ b/score/mw/com/impl/bindings/lola/test_doubles/BUILD @@ -12,7 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "fake_memory_resource", diff --git a/score/mw/com/impl/bindings/lola/tracing/BUILD b/score/mw/com/impl/bindings/lola/tracing/BUILD index 3c5e80667..79d72ca44 100644 --- a/score/mw/com/impl/bindings/lola/tracing/BUILD +++ b/score/mw/com/impl/bindings/lola/tracing/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "tracing_runtime", diff --git a/score/mw/com/impl/bindings/mock_binding/BUILD b/score/mw/com/impl/bindings/mock_binding/BUILD index b2c0a79de..86af4ecb2 100644 --- a/score/mw/com/impl/bindings/mock_binding/BUILD +++ b/score/mw/com/impl/bindings/mock_binding/BUILD @@ -13,7 +13,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library") load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "component") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") component( name = "mock_component", diff --git a/score/mw/com/impl/bindings/mock_binding/tracing/BUILD b/score/mw/com/impl/bindings/mock_binding/tracing/BUILD index a6ac5b62e..0bd8943ef 100644 --- a/score/mw/com/impl/bindings/mock_binding/tracing/BUILD +++ b/score/mw/com/impl/bindings/mock_binding/tracing/BUILD @@ -12,7 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "tracing_runtime", diff --git a/score/mw/com/impl/configuration/BUILD b/score/mw/com/impl/configuration/BUILD index 54604e663..3f2592124 100644 --- a/score/mw/com/impl/configuration/BUILD +++ b/score/mw/com/impl/configuration/BUILD @@ -12,9 +12,9 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//bazel/tools:json_schema_validator.bzl", "validate_json_schema_test") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") validate_json_schema_test( name = "validate_mw_com_config_schema", diff --git a/score/mw/com/impl/configuration/test/BUILD b/score/mw/com/impl/configuration/test/BUILD index 3bdfe9294..cd4cb7e25 100644 --- a/score/mw/com/impl/configuration/test/BUILD +++ b/score/mw/com/impl/configuration/test/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//bazel/tools:json_schema_validator.bzl", "validate_json_schema_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "configuration_test_resources", diff --git a/score/mw/com/impl/methods/BUILD b/score/mw/com/impl/methods/BUILD index 31a63d02e..92ea60cc5 100644 --- a/score/mw/com/impl/methods/BUILD +++ b/score/mw/com/impl/methods/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "method_signature_element_ptr", diff --git a/score/mw/com/impl/methods/test/BUILD b/score/mw/com/impl/methods/test/BUILD index 4ed73ddc6..56f60b9e6 100644 --- a/score/mw/com/impl/methods/test/BUILD +++ b/score/mw/com/impl/methods/test/BUILD @@ -12,7 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "callable_traits_resources", diff --git a/score/mw/com/impl/mocking/BUILD b/score/mw/com/impl/mocking/BUILD index aca16021a..26873f8ec 100644 --- a/score/mw/com/impl/mocking/BUILD +++ b/score/mw/com/impl/mocking/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "test_type_utilities", diff --git a/score/mw/com/impl/plumbing/BUILD b/score/mw/com/impl/plumbing/BUILD index b4592d373..105c7871f 100644 --- a/score/mw/com/impl/plumbing/BUILD +++ b/score/mw/com/impl/plumbing/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "plumbing", diff --git a/score/mw/com/impl/rust/com-api/com-api-ffi-lola/BUILD b/score/mw/com/impl/rust/com-api/com-api-ffi-lola/BUILD index 1456bedaf..fd7bfaa71 100644 --- a/score/mw/com/impl/rust/com-api/com-api-ffi-lola/BUILD +++ b/score/mw/com/impl/rust/com-api/com-api-ffi-lola/BUILD @@ -13,7 +13,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_rust//rust:defs.bzl", "rust_library") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "registry_bridge_macro_cpp", diff --git a/score/mw/com/impl/test/BUILD b/score/mw/com/impl/test/BUILD index 02f58fc7e..6c44b1b2a 100644 --- a/score/mw/com/impl/test/BUILD +++ b/score/mw/com/impl/test/BUILD @@ -12,7 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "binding_factory_resources", diff --git a/score/mw/com/impl/tracing/BUILD b/score/mw/com/impl/tracing/BUILD index ca24f25a5..34a8a1ad7 100644 --- a/score/mw/com/impl/tracing/BUILD +++ b/score/mw/com/impl/tracing/BUILD @@ -12,8 +12,8 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") package( default_visibility = [ diff --git a/score/mw/com/impl/tracing/configuration/BUILD b/score/mw/com/impl/tracing/configuration/BUILD index db94b5476..e446e6dce 100644 --- a/score/mw/com/impl/tracing/configuration/BUILD +++ b/score/mw/com/impl/tracing/configuration/BUILD @@ -12,9 +12,9 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//bazel/tools:json_schema_validator.bzl", "validate_json_schema_test") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") validate_json_schema_test( name = "validate_comtrace_filter_config_schema", diff --git a/score/mw/com/impl/tracing/test/BUILD b/score/mw/com/impl/tracing/test/BUILD index cedf0a225..aa34da223 100644 --- a/score/mw/com/impl/tracing/test/BUILD +++ b/score/mw/com/impl/tracing/test/BUILD @@ -11,8 +11,8 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") package(default_visibility = [ "//score/mw/com/impl/tracing/test:__subpackages__", diff --git a/score/mw/com/impl/util/BUILD b/score/mw/com/impl/util/BUILD index 79dbe886e..41d26fdd4 100644 --- a/score/mw/com/impl/util/BUILD +++ b/score/mw/com/impl/util/BUILD @@ -12,7 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "copyable_atomic", diff --git a/score/mw/com/impl/util/test/BUILD b/score/mw/com/impl/util/test/BUILD index 654fd4f30..2e048d445 100644 --- a/score/mw/com/impl/util/test/BUILD +++ b/score/mw/com/impl/util/test/BUILD @@ -13,13 +13,13 @@ load("@rules_build_error//lang/cc:defs.bzl", "cc_build_error_test") load("@rules_build_error//matcher:defs.bzl", "matcher") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_unit_test( name = "copyable_atomic_test", srcs = ["copyable_atomic_test.cpp"], - features = COMPILER_WARNING_FEATURES, + features = COMPILER_WARNING_FEATURES + ["-score_communication_treat_warnings_as_errors"], deps = [ "//score/mw/com/impl/util:copyable_atomic", ], diff --git a/score/mw/com/mocking/BUILD b/score/mw/com/mocking/BUILD index c51eaea42..a46f6dff9 100644 --- a/score/mw/com/mocking/BUILD +++ b/score/mw/com/mocking/BUILD @@ -1,6 +1,6 @@ load("@rules_cc//cc:defs.bzl", "cc_library") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test") -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "test_type_utilities", diff --git a/score/mw/service/BUILD b/score/mw/service/BUILD index 9110fdb6e..d237a18a3 100644 --- a/score/mw/service/BUILD +++ b/score/mw/service/BUILD @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "provided_service", diff --git a/score/mw/service/backend/mw_com/BUILD b/score/mw/service/backend/mw_com/BUILD index 2ab4eb398..0582db066 100644 --- a/score/mw/service/backend/mw_com/BUILD +++ b/score/mw/service/backend/mw_com/BUILD @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("//score/mw:common_features.bzl", "COMPILER_WARNING_FEATURES") +load("//:score/common_features.bzl", "COMPILER_WARNING_FEATURES") cc_library( name = "provided_service_builder",