Skip to content

refactor(quality): rework compiler-warning cc_features and fix flag placement - #765

Merged
castler merged 1 commit into
eclipse-score:mainfrom
AAmbuj:amsh_refactor_compiler_warnings
Jul 27, 2026
Merged

refactor(quality): rework compiler-warning cc_features and fix flag placement#765
castler merged 1 commit into
eclipse-score:mainfrom
AAmbuj:amsh_refactor_compiler_warnings

Conversation

@AAmbuj

@AAmbuj AAmbuj commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Restructure the score_communication compiler-warning toolchain features so they are correct, toolchain-aware, and duplication-free.

  • MODULE.bazel: repoint to //quality/compiler_warnings/clang:default_flags and clang:additional_warnings; remove the stale :default_flags / :default_link_flags refs that broke all cc analysis. Keep the raw SCORE_GCC minimal baseline in sync with the gcc/ minimal feature.
  • Define the public features (minimal/strict/additional_warnings) per toolchain in clang/ and gcc/, each implying a shared common base, so requesting a feature yields the full toolchain-specific flag set.
  • Place every flag by compiler (verified by probing gcc/clang): GCC-only in gcc/, Clang-only in clang/, dual-support in common. Move -Wfloat-equal to common; move -Wno-deprecated-non-prototype to clang.
  • De-duplicate: drop -fstack-protector (superseded by -fstack-protector-strong); source -lrt/-latomic from the toolchain link_libs only.
  • Fix GCC -Wno-error= demotions (drop malformed level suffixes; restore the valid GCC-only -Wno-error=tsan) and prepend -Werror so the demotions in strict_warnings_no_error reliably take effect.
  • Add security-hardening compile/link defaults (_FORTIFY_SOURCE, RELRO+BIND_NOW, stack-clash-protection, CET/-fcf-protection).
  • Regenerate visibility_guard golden; sync test/README.md and quality.md.

@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch from 9a8cfb3 to 3d47478 Compare July 24, 2026 11:10
@AAmbuj
AAmbuj marked this pull request as ready for review July 24, 2026 11:10
@AAmbuj AAmbuj self-assigned this Jul 24, 2026
Comment thread quality/compiler_warnings/BUILD Outdated
Comment on lines +41 to +42
"-D_QNX_SOURCE",
"-D_XOPEN_SOURCE=700", # SUSv4 (POSIX.1-2008 base specification plus the XSI extension)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why would we set this? This should come from QCC, and not be set by us manually.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, fixed!

Comment on lines -51 to -55
# 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.
# raised a ticket in score_baselibs to fix this issue, but for now we demote it to warning
# Bug ticket: (https://github.com/eclipse-score/baselibs/issues/304)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why removing this explanation comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

its fixed! in the baselibs

@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch 5 times, most recently from 291e3e5 to 62df7a9 Compare July 27, 2026 09:46
castler
castler previously approved these changes Jul 27, 2026
@castler
castler enabled auto-merge July 27, 2026 09:59
@castler
castler added this pull request to the merge queue Jul 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 27, 2026
@castler castler added the test-qnx Enables the checks with QNX toolchains. Checks require committer approval to start execution. label Jul 27, 2026
@castler
castler temporarily deployed to workflow-approval July 27, 2026 10:32 — with GitHub Actions Inactive
@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch from 62df7a9 to 4e89e2d Compare July 27, 2026 10:37
@AAmbuj
AAmbuj temporarily deployed to workflow-approval July 27, 2026 10:37 — with GitHub Actions Inactive
@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch 2 times, most recently from 68049b3 to 07ae26c Compare July 27, 2026 10:53
@AAmbuj
AAmbuj temporarily deployed to workflow-approval July 27, 2026 10:59 — with GitHub Actions Inactive
@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch from 07ae26c to 951c002 Compare July 27, 2026 12:22
@AAmbuj
AAmbuj temporarily deployed to workflow-approval July 27, 2026 12:22 — with GitHub Actions Inactive
@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch from 951c002 to 4e5a8c0 Compare July 27, 2026 12:23
@AAmbuj
AAmbuj temporarily deployed to workflow-approval July 27, 2026 13:12 — with GitHub Actions Inactive
@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch from 4e5a8c0 to 5e22419 Compare July 27, 2026 14:22
…lacement

Restructure the score_communication compiler-warning toolchain features so
they are correct, toolchain-aware, and duplication-free.

- MODULE.bazel: repoint to //quality/compiler_warnings/clang:default_flags
  and clang:additional_warnings; remove the stale :default_flags /
  :default_link_flags refs that broke all cc analysis. Keep the raw
  SCORE_GCC minimal baseline in sync with the gcc/ minimal feature.
- Define the public features (minimal/strict/additional_warnings) per
  toolchain in clang/ and gcc/, each implying a shared common base, so
  requesting a feature yields the full toolchain-specific flag set.
- Place every flag by compiler (verified by probing gcc/clang): GCC-only in
  gcc/, Clang-only in clang/, dual-support in common. Move -Wfloat-equal to
  common; move -Wno-deprecated-non-prototype to clang.
- De-duplicate: drop -fstack-protector (superseded by -fstack-protector-strong);
  source -lrt/-latomic from the toolchain link_libs only.
- Fix GCC -Wno-error= demotions (drop malformed level suffixes; restore the
  valid GCC-only -Wno-error=tsan) and prepend -Werror so the demotions in
  strict_warnings_no_error reliably take effect.
- Add security-hardening compile/link defaults (_FORTIFY_SOURCE, RELRO+BIND_NOW,
  stack-clash-protection, CET/-fcf-protection).
- Regenerate visibility_guard golden; sync test/README.md and quality.md.
@AAmbuj
AAmbuj force-pushed the amsh_refactor_compiler_warnings branch from 5e22419 to 301a506 Compare July 27, 2026 15:07
@AAmbuj AAmbuj moved this from Backlog to Ready in COM - Communication FT Jul 27, 2026
@AAmbuj
AAmbuj deployed to workflow-approval July 27, 2026 15:32 — with GitHub Actions Active
@castler
castler enabled auto-merge July 27, 2026 17:51
@castler
castler added this pull request to the merge queue Jul 27, 2026
Merged via the queue into eclipse-score:main with commit c3db8d0 Jul 27, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in COM - Communication FT Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-qnx Enables the checks with QNX toolchains. Checks require committer approval to start execution.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants