lib/commonio.c: Rename structure members that look like libc APIs#1324
Merged
Conversation
Member
|
Does any libc do this? |
Collaborator
Author
I'm experimenting with an I've installed the following header (written by the committee member that authored the proposal of It wraps libc APIs to add the qualifier where appropriate. And it indeed does this by necessity. Cc: @chrisbazley |
40c6de8 to
cfd0511
Compare
Collaborator
Author
|
How about changing the names of the structure members to be prefixed with |
190be12 to
8e79275
Compare
8e79275 to
f38b58d
Compare
…e members This structure has members that are named like libc APIs. libc is allowed to provide any functions as macros (7.1.4p1 in C23). This means that libc is allowed to provide a free(3) macro, which could look like #define free(p) __free(p) And that would be expanded by the preprocessor in our code, turning our structure members into some code that won't work (or even worse, it might misbehave). So, fix this undefined behavior. Signed-off-by: Alejandro Colomar <[email protected]>
f38b58d to
6b8a5d2
Compare
hallyn
approved these changes
Oct 18, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
libc is allowed to provide any functions as macros (7.1.4p1 in C23).
This means that libc is allowed to provide a free(3) macro, which could look like
And that would be expanded by the preprocessor in our code, turning our structure members into some code that won't work (or even worse, it might misbehave).
So, fix this undefined behavior.
Revisions:
v1b
v1c
v1d
v2
v2b
v2c