-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
lib: fix function pointers to please UndefinedBehaviorSanitizer #15289
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
Merged
+310
−307
Conversation
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
jay
reviewed
Oct 14, 2024
75b31c5
to
dffb408
Compare
This comment was marked as outdated.
This comment was marked as outdated.
b979979
to
cedf3c1
Compare
b472bb1
to
fe9e69a
Compare
Make sure we use functions with the correct prototype. Closes #15289
It makes the callbacks get different signnatures when used from within libcurl vs outside of it by libcurl-using applications (such as the libtests) and this triggers UndefinedBehaviorSanitizer errors. Closes #15289
Loading status checks…
Make test applications use the correct prototypes for callbacks. Closes #15289
fe9e69a
to
8403e5a
Compare
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
Make sure we use functions with the correct prototype. Closes curl#15289
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
It makes the callbacks get different signnatures when used from within libcurl vs outside of it by libcurl-using applications (such as the libtests) and this triggers UndefinedBehaviorSanitizer errors. Closes curl#15289
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
Make test applications use the correct prototypes for callbacks. Closes curl#15289
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.
Use plain typecasts instead to make it more obvious what the code does.
The UndefinedBehaviorSanitizer (ubsan) now errors if a callback pointer is used to a call a function with ever so slight difference in signature. This is annoying because it means that we can no longer use our long established practice of using a different typedef for several handles when building the library vs when using it. We used to have a plain struct pointer for libcurl builds and a
void *
for that name when the header is used for applications.