Skip to content

Conversation

@iav
Copy link
Contributor

@iav iav commented Jan 28, 2026

Summary

  • When building kernels with KERNEL_COMPILER=clang, compiler warnings were displayed without color
  • The GCC-native flag -fdiagnostics-color=always (set in KCFLAGS) is not reliably honored by clang when invoked through ccache and the kernel build system with LLVM=1
  • Added -fcolor-diagnostics (clang's native flag) to the clang-specific extra_warnings to ensure colored output

Test plan

  • Built kernel with KERNEL_COMPILER=clang — warnings now have ANSI color codes
  • Verify no regressions with default GCC builds

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced compiler output formatting with colored diagnostics support for improved build log readability.

✏️ Tip: You can customize this high-level summary in your review settings.

When building kernels with KERNEL_COMPILER=clang, compiler warnings
were displayed without color despite -fdiagnostics-color=always being
set in KCFLAGS. This GCC-native flag is not reliably honored by clang
when invoked through ccache and the kernel build system with LLVM=1.

Add -fcolor-diagnostics (clang's native flag) to the clang-specific
extra_warnings to ensure colored warning output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@iav iav requested a review from a team as a code owner January 28, 2026 21:50
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

A compiler flag modification in the kernel build script adds color diagnostics support (-fcolor-diagnostics) to the clang compilation warnings configuration, preserving existing error suppression behavior.

Changes

Cohort / File(s) Summary
Clang compiler configuration
lib/functions/compilation/kernel-make.sh
Added -fcolor-diagnostics flag to extra_warnings in the clang path of run_kernel_make_internal function while retaining existing -Wno-error=unused-command-line-argument suppression

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 With colors now bright, diagnostics will gleam,
Clang's warnings dance in a vibrant dream,
Red flags and blues to guide the code flow,
Making compiler feedback easier to know! 🌈

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and directly describes the main change: adding colored diagnostic output support for clang during kernel compilation, which matches the primary objective of enabling the -fcolor-diagnostics flag.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size/small PR with less then 50 lines 02 Milestone: First quarter release Needs review Seeking for review Framework Framework components labels Jan 28, 2026
@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Jan 28, 2026
@github-actions
Copy link
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions bot removed the Needs review Seeking for review label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release Framework Framework components Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

2 participants