Summary
Move all compiler warning flag definitions currently owned by score_bazel_cpp_toolchains into score_cpp_policies and make toolchains consume them from this module instead of defining them on toolchain Bazel configuration module.
score_cpp_policies already acts as the central home for reusable C++ quality policy such as sanitizers and clang-tidy. Compiler warning policy should live there as well so warning levels and exceptions are defined once and reused consistently across S-CORE modules.
Problem
Warning policy is currently embedded in the toolchain templates instead of being managed as a shared policy layer. That creates a few problems:
- Warning levels are not centrally managed alongside other C++ quality policies.
- Consumers cannot adopt a shared warning policy independently of the toolchain implementation.
- Exceptions such as
-Wno-error=deprecated-declarations and -Wno-error=mismatched-new-delete are owned by the toolchain rather than the policy module.
- Changing warning policy requires touching the toolchain repository instead of the policy repository.
Scope
Migrate all compiler warning-related flags from this module to score_cpp_policies, including:
- Base warning feature groups:
minimal_warnings
strict_warnings
all_wall_warnings
warnings_as_errors
- Language-specific warning groups:
- C-only warning flags
- C++-only warning flags
- Warning suppressions and exceptions currently expressed as compiler flags, including:
-Wno-builtin-macro-redefined
-Wno-error=deprecated-declarations
-Wno-error=mismatched-new-delete
-Werror
- Both Linux and QNX variants of the current warning policy
This should cover all -W* compiler warning flags currently defined by the toolchain templates. Non-warning compile flags, optimization flags, sysroot handling, and linker defaults are out of scope.
Expected Outcome
After this change:
score_cpp_policies becomes the single source of truth for compiler warning policy.
bazel_cpp_toolchains no longer hardcodes warning flag sets locally.
- Linux and QNX toolchains consume warning features provided by
score_cpp_policies.
- Existing warning feature names remain usable, or a documented migration path is provided if names must change.
Proposed Approach
- Add warning-policy feature definitions to
score_cpp_policies.
- Represent the current warning levels there in a form that toolchains can import or register cleanly.
- Update this toolchain module to wire those imported features into the Linux and QNX toolchains.
- Remove local warning flag definitions once consumers are switched over.
- Document the new integration and any required migration steps for downstream users.
Acceptance Criteria
- All warning-related compiler flags currently defined in
score_cpp_policies are migrated to score_cpp_policies.
- No warning flag groups remain defined locally in the toolchain templates.
- Linux toolchains still expose the current warning feature behavior after migration.
- QNX toolchains still expose the current warning feature behavior after migration.
- Existing example builds continue to work with the migrated warning policy.
- Documentation explains how consumers enable warning levels after the migration.
Impact analysis
Users will need to define warning flags that we want to include.
Summary
Move all compiler warning flag definitions currently owned by
score_bazel_cpp_toolchainsintoscore_cpp_policiesand make toolchains consume them from this module instead of defining them on toolchain Bazel configuration module.score_cpp_policiesalready acts as the central home for reusable C++ quality policy such as sanitizers and clang-tidy. Compiler warning policy should live there as well so warning levels and exceptions are defined once and reused consistently across S-CORE modules.Problem
Warning policy is currently embedded in the toolchain templates instead of being managed as a shared policy layer. That creates a few problems:
-Wno-error=deprecated-declarationsand-Wno-error=mismatched-new-deleteare owned by the toolchain rather than the policy module.Scope
Migrate all compiler warning-related flags from this module to
score_cpp_policies, including:minimal_warningsstrict_warningsall_wall_warningswarnings_as_errors-Wno-builtin-macro-redefined-Wno-error=deprecated-declarations-Wno-error=mismatched-new-delete-WerrorThis should cover all
-W*compiler warning flags currently defined by the toolchain templates. Non-warning compile flags, optimization flags, sysroot handling, and linker defaults are out of scope.Expected Outcome
After this change:
score_cpp_policiesbecomes the single source of truth for compiler warning policy.bazel_cpp_toolchainsno longer hardcodes warning flag sets locally.score_cpp_policies.Proposed Approach
score_cpp_policies.Acceptance Criteria
score_cpp_policiesare migrated toscore_cpp_policies.Impact analysis
Users will need to define warning flags that we want to include.