-
Notifications
You must be signed in to change notification settings - Fork 497
Clang21 build fix #10998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Clang21 build fix #10998
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ | |
| # | ||
| # Initialize CFLAGS | ||
| # | ||
| BASE_CFLAGS="-g -Wall -Werror" | ||
| BASE_CFLAGS="-g -Wall" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So that was the idea before, but thought -Werror should be enabled in dev builds only. You can see what I initially did to suppress the build failure with clang here: https://github.com/openucx/ucx/compare/6f11c87850dd7b401e975e56e915a6a771478351
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we can fix the code to avoid the warning - this is preferred. |
||
|
|
||
| # Prevent libtool from suppression of warnings | ||
| LT_CFLAGS="-no-suppress" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider a more targeted approach than removing
-Werrorentirely.Removing
-WerrorfromBASE_CFLAGSdisables error-on-warning for the entire build, which reduces code quality enforcement. This means all warnings—not just the Clang 21-Wdefault-const-init-var-unsafeissue—will be silently ignored, potentially masking future bugs.Recommended alternatives:
Selectively disable the problematic warning (preferred):
Then add after line 302:
Version-specific handling (if the warning only affects Clang 21+):
Detect the compiler version and conditionally apply flags only when needed.
The file already provides
ADD_COMPILER_FLAG_IF_SUPPORTEDandCHECK_COMPILER_FLAGmacros (lines 252, 226) specifically for this purpose. Using-Wno-error=default-const-init-var-unsafewould downgrade only this specific warning to non-fatal while preserving-Werrorfor all other warnings.🤖 Prompt for AI Agents