Skip to content

Add cpp warnings features. - #33

Merged
nradakovic merged 3 commits into
mainfrom
nira_add_warnings_features
Aug 26, 2026
Merged

nradakovic merged 3 commits into
mainfrom
nira_add_warnings_features

Conversation

@nradakovic

@nradakovic nradakovic commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

Add cpp warnings features.

@nradakovic nradakovic self-assigned this Aug 17, 2026
@nradakovic nradakovic added enhancement New feature or request p3 Medium/Low - handle it within normal process compiler warnings Compiler warnings feature add or update. labels Aug 17, 2026
Add cpp warnings features.
@nradakovic
nradakovic force-pushed the nira_add_warnings_features branch from 66888a2 to d3d2482 Compare August 17, 2026 19:53
@nradakovic nradakovic moved this from Backlog to Ready in S-CORE Roadmap Aug 20, 2026
@nradakovic nradakovic moved this from Ready to In Progress in S-CORE Roadmap Aug 20, 2026
@nradakovic
nradakovic marked this pull request as ready for review August 20, 2026 12:52
Copilot AI lite review requested due to automatic review settings August 20, 2026 12:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a centralized, Bazel rules_cc-based warning policy for GCC toolchains, exposing warning “levels” and a separate -Werror toggle intended for use across S-CORE C/C++ builds.

Changes:

  • Introduces GCC warning cc_feature targets for minimal, strict, all, plus warnings_as_errors.
  • Adds OS-specific GCC -W... flag lists for Linux and QNX and composes them via cc_args_list with select() on @platforms//os.
  • Documents the warning feature architecture and the intent/semantics of each warning level.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
warnings/gcc/features/BUILD Defines public GCC cc_feature targets for warning levels and warnings_as_errors.
warnings/gcc/args/BUILD Composes per-OS warning arg targets via cc_args_list and select() by OS.
warnings/gcc/args/linux/BUILD Linux-specific GCC warning flag lists for minimal/strict/all and -Werror.
warnings/gcc/args/qnx/BUILD QNX-specific GCC warning flag lists for minimal/strict/all and -Werror.
docs/warnings.md Documents the warning feature hierarchy, flag lists, and intended usage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/warnings.md
Comment thread warnings/gcc/args/qnx/BUILD
@nradakovic
nradakovic force-pushed the nira_add_warnings_features branch from 4dcd9de to 63ce2e9 Compare August 20, 2026 13:06
antonkri
antonkri previously approved these changes Aug 20, 2026
Add proper documentation for warnings features explaining each
feature which flags are including and for which platform feature
is meant.
AlexanderLanin
AlexanderLanin previously approved these changes Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Comment thread warnings/gcc/features/BUILD Outdated
cc_feature(
name = level + "_warnings",
args = ["@score_cpp_policies//warnings/gcc/args:{}_warnings_args".format(level)],
feature_name = level + "_warnings",
Comment thread warnings/gcc/args/linux/BUILD Outdated
Comment thread docs/warnings.md Outdated
Comment on lines +7 to +8
> **Note:** If you're using `score_bazel_cpp_toolchains`, keep in mind that
> these warning features require version `1.0.0` or above.
Comment thread warnings/gcc/args/qnx/BUILD Outdated
],
args = [
"-Waddress",
"-Warray-bounds=1",
Comment on lines +24 to +28
cc_feature(
name = level + "_warnings",
args = ["@score_cpp_policies//warnings/gcc/args:{}_warnings_args".format(level)],
feature_name = level + "_warnings",
implies = [_WARNING_LEVELS[i - 1] + "_warnings"] if i > 0 else [],

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We know. For now no new tests are added.

Comment thread warnings/gcc/args/linux/BUILD Outdated
load("@rules_cc//cc/toolchains:args.bzl", "cc_args")

# --------------------------------------------------------------------------------
# All minimal compiler warnings (enabled by default).
Comment thread docs/warnings.md Outdated

| Feature | Meaning |
|---|---|
| `minimal_warnings` | Baseline warnings enabled by default; low false-positive rate. |
The all warnings feature name was not aligned with toolchain
module. With this change all docs are aligned.
@nradakovic
nradakovic merged commit c7d9ec0 into main Aug 26, 2026
20 checks passed
@nradakovic
nradakovic deleted the nira_add_warnings_features branch August 26, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler warnings Compiler warnings feature add or update. enhancement New feature or request p3 Medium/Low - handle it within normal process

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Update score_cpp_policies documentation for compiler warning features Define compiler warning features in score_cpp_policies

4 participants