Summary
This task introduces a new Bazel cc_feature named misra_cpp_2023_warnings. The feature shall enable the compiler warnings identified in the S-CORE MISRA C++:2023 Guideline Enforcement Plan (GEP) as applicable to GCC and Clang.
The initial implementation is intended as a first draft of the warning set. The mapping and selected warnings may be refined as the MISRA enforcement strategy and compiler support evolve.
Goal
Provide a reusable Bazel C/C++ feature that enables compiler diagnostics relevant to the enforcement of MISRA C++:2023 guidelines.
The initial warning set shall be derived from the compiler-warning mappings defined in the S-CORE MISRA C++:2023 GEP:
https://github.com/eclipse-score/communication/blob/main/quality/static_analysis/misra_gep.md
The feature should provide a single, consistent entry point for enabling the MISRA C++:2023-oriented compiler warnings in supported C/C++ builds.
Scope
The implementation should cover:
- Adding the
misra_cpp_2023_warnings cc_feature
- Adding the GCC warnings identified in the MISRA C++:2023 GEP
- Adding the corresponding Clang warnings where applicable
- Handling compiler-specific warning availability appropriately
- Integrating the feature into the existing C/C++ warning policy infrastructure
- Validating the feature with representative C/C++ targets
The first draft should focus specifically on compiler warnings listed in the GEP. MISRA rules covered exclusively by CodeQL or other static-analysis tools are outside the scope of this task.
Proposed Implementation
- Add a new
cc_feature named misra_cpp_2023_warnings
- Map the warning options from the MISRA C++:2023 GEP to the corresponding compiler configuration
- Provide GCC-specific warning options where defined by the GEP
- Provide Clang-specific warning options where defined by the GEP
- Ensure unsupported compiler-specific warnings do not break toolchain configuration
- Make the feature independently selectable from other warning sets
- Integrate the feature with the existing C/C++ policy configuration
Validation Expectations
Before closing this task, verify:
- The
misra_cpp_2023_warnings feature is correctly recognized by the Bazel C/C++ toolchain configuration
- GCC builds successfully when the feature is enabled
- Clang builds successfully when the feature is enabled
- The expected warning options are passed to the compiler
- Compiler-specific warnings are only enabled for compilers that support them
- Representative code violating applicable MISRA-related compiler diagnostics produces the expected warnings
- The feature does not introduce unrelated compiler options
- Existing warning sets and configurations remain unaffected when the feature is not enabled
Acceptance Criteria
- A
misra_cpp_2023_warnings cc_feature is implemented
- The feature contains the first-draft set of GCC warnings identified in the S-CORE MISRA C++:2023 GEP
- The corresponding applicable Clang warnings are included
- Compiler-specific differences are handled correctly
- The feature can be enabled independently through the existing Bazel C/C++ configuration
- The implementation is validated with representative GCC and Clang builds
- The implemented warning mapping is documented and traceable to the MISRA C++:2023 GEP
- It is explicitly documented that this compiler warning set provides only partial MISRA C++:2023 enforcement and does not constitute complete MISRA compliance
Checklist
Summary
This task introduces a new Bazel
cc_featurenamedmisra_cpp_2023_warnings. The feature shall enable the compiler warnings identified in the S-CORE MISRA C++:2023 Guideline Enforcement Plan (GEP) as applicable to GCC and Clang.The initial implementation is intended as a first draft of the warning set. The mapping and selected warnings may be refined as the MISRA enforcement strategy and compiler support evolve.
Goal
Provide a reusable Bazel C/C++ feature that enables compiler diagnostics relevant to the enforcement of MISRA C++:2023 guidelines.
The initial warning set shall be derived from the compiler-warning mappings defined in the S-CORE MISRA C++:2023 GEP:
https://github.com/eclipse-score/communication/blob/main/quality/static_analysis/misra_gep.md
The feature should provide a single, consistent entry point for enabling the MISRA C++:2023-oriented compiler warnings in supported C/C++ builds.
Scope
The implementation should cover:
misra_cpp_2023_warningscc_featureThe first draft should focus specifically on compiler warnings listed in the GEP. MISRA rules covered exclusively by CodeQL or other static-analysis tools are outside the scope of this task.
Proposed Implementation
cc_featurenamedmisra_cpp_2023_warningsValidation Expectations
Before closing this task, verify:
misra_cpp_2023_warningsfeature is correctly recognized by the Bazel C/C++ toolchain configurationAcceptance Criteria
misra_cpp_2023_warningscc_featureis implementedChecklist
misra_cpp_2023_warningsfeature