-
Notifications
You must be signed in to change notification settings - Fork 606
fix(fcode-utils): fix GCC 15/C23 build failure with -std=gnu17 overlay #15908
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
Closed
dmcilvaney
wants to merge
1
commit into
microsoft:tomls/base/main
from
dmcilvaney:damcilva/4.0/pkg_fixes/fcode-utils
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [components.fcode-utils] | ||
|
|
||
| # Upstream project is dormant (last release v1.0.3 in 2014). The codebase uses | ||
| # K&R-style function pointer declarations (e.g. void (*funct)()) and redefines | ||
| # bool via typedef, which are incompatible with C23 defaults in GCC 15: | ||
| # 1. bool is a keyword in C23; typedef to bool is a hard error | ||
| # 2. () means zero params in C23; calling through () pointers with args is an error | ||
| # 3. Incompatible pointer type assignments are promoted to errors | ||
| # An upstream fix (partial) exists but is not merged: https://github.com/openbios/fcode-utils/pull/32 | ||
| # Fedora has not patched this either as of rawhide (Feb 2026). | ||
| # Force C17 mode to restore pre-C23 semantics until upstream modernizes. | ||
| [[components.fcode-utils.overlays]] | ||
| description = "Fix GCC 15/C23 build failures by forcing C17 mode for K&R-style function pointers and bool typedef" | ||
| type = "spec-search-replace" | ||
| regex = 'CFLAGS=.%\{optflags\}.' | ||
| replacement = 'CFLAGS="%{optflags} -std=gnu17"' | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The regex pattern uses
.as a wildcard to match the quote characters around%{optflags}. While this works, it could be more precise by using literal quote characters instead. Consider changing the regex to use explicit quotes for better clarity and to avoid potential edge cases:Change from:
regex = 'CFLAGS=.%\{optflags\}.'To:
regex = 'CFLAGS="%\{optflags\}"'This makes the pattern more explicit about matching double-quoted CFLAGS assignments. However, since you've already validated this with prep-sources and build testing, the current pattern is acceptable.