Repository navigation
objc: Don't panic on Objective-C methods with C-style parameters - #3524
Merged
Merged
Conversation
emilio
approved these changes
Oct 16, 2026
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.
Fixes #3488.
An Objective-C method that declares C-style parameters is accepted by clang, with
-Wdeprecated-declarations:Both parameters land in clang's parameter list, but the selector is still
take:.format_method_callasserted that the two counts agreed. bindgen aborted:
msg_send!dispatches on the selector. A method with a parameter count that disagrees with its selectorcannot be represented and emitting it would produce a call with the wrong argument list.
Skip the method and warn instead of aborting.
The crate already does this for other constructs it cannot support (
ir/var.rs).The output for valid Objective-C is unchanged. Across the 19
objc*.htest headers, 18 producebyte-identical output. The only difference is
objc_c_style_params.h, which previously aborted(exit 101) and now succeeds (exit 0).
Two extra things:
loggingfeature off,warn!emits nothing. A skipped method is dropped silently.produces two identical warnings.
cargo test -p bindgen-tests: 638 passed, 2 failed. Both fail identically on the base commit.