Skip to content

Pass system header paths to fallback parser - #3440

Merged
emilio merged 1 commit into
rust-lang:mainfrom
dimtpap:pass-isystem-to-fallback
Sep 5, 2026
Merged

Pass system header paths to fallback parser#3440
emilio merged 1 commit into
rust-lang:mainfrom
dimtpap:pass-isystem-to-fallback

Conversation

@dimtpap

@dimtpap dimtpap commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This is similar to #3353 but for automatically detected header paths.

Consider

#include <stddef.h>

#define TEST ((size_t)42)

To create a binding for TEST, bindgen uses the fallback path to parse macros. Currently though it silently fails because of the inclusion of stddef.h, which is a header provided by the compiler (at least in the case of GCC and clang on x86_64-pc-linux-gnu), since the fallback parser is unaware of the location of that header. This PR makes it so that detected system header paths are passed to the fallback parser as well.

@dimtpap dimtpap changed the title Pass system headers to fallback unit Pass system header paths to fallback parser Aug 28, 2026
If a macro needed to be parsed using the fallback parser but the macro
used items included in a builtin header, the parsing would fail since
the location of the header would be unknown.
@dimtpap
dimtpap force-pushed the pass-isystem-to-fallback branch from 89228cd to 53df2d8 Compare August 28, 2026 12:43
@emilio
emilio added this pull request to the merge queue Sep 5, 2026
Merged via the queue into rust-lang:main with commit d080589 Sep 5, 2026
51 checks passed
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.

2 participants