Skip to content

Conversation

chertov
Copy link

@chertov chertov commented Oct 13, 2025

  • add a generate_hidden_functions option so bindgen can keep functions that Clang marks with hidden/protected visibility (fixes The compiled code has no functions #2989)
  • allow Function::parse to honor the new option instead of dropping those declarations unconditionally

@ivmaykov
Copy link
Contributor

I think you need to add some test cases

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, but let's use the easier-to-manage test framework since there's nothing special about this test. Just use // bindgen-flags: --generate-hidden-functions in the header.

.allowlist_function("hidden_fn")
.allowlist_function("protected_fn")
.header_contents("hidden.h", HIDDEN_FUNCTIONS_HEADER)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reuse the existing test framework instead. I.e. add a header to bindgen-tests/tests/headers and the generated file to bindgen-tests/tests/expectations. That way we can test the whole content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The compiled code has no functions

3 participants