Skip to content

Fix detection of va_list type#20

Merged
nunoplopes merged 4 commits intoCpp2Rust:masterfrom
lucic71:macos-vaarg
Apr 20, 2026
Merged

Fix detection of va_list type#20
nunoplopes merged 4 commits intoCpp2Rust:masterfrom
lucic71:macos-vaarg

Conversation

@lucic71
Copy link
Copy Markdown
Contributor

@lucic71 lucic71 commented Apr 20, 2026

On macOS va_list is typedef'ed to char*, on Linux is typedefed to __va_list_tag[1]. Traverse the TypedefType/AdjustedType in order to check if a type is va_list instead of checking against the Linux specific __va_list_tag.

@lucic71
Copy link
Copy Markdown
Contributor Author

lucic71 commented Apr 20, 2026

Fixes the macOS errors in #12

@lucic71
Copy link
Copy Markdown
Contributor Author

lucic71 commented Apr 20, 2026

In C++ mode, for va_list, on both macOS and Ubuntu, clang typedefs to struct __va_list_tag[1].

In C mode, clang typedefs to struct __va_list_tag[1] on Ubuntu and to char* on macOS.

That's why the va_arg tests broke after switching to C mode.

@nunoplopes
Copy link
Copy Markdown
Contributor

3 tests still failing

@lucic71
Copy link
Copy Markdown
Contributor Author

lucic71 commented Apr 20, 2026

3 tests still failing

It works now

@nunoplopes nunoplopes merged commit 2bf5df6 into Cpp2Rust:master Apr 20, 2026
9 checks passed
@lucic71 lucic71 deleted the macos-vaarg branch April 29, 2026 13:18
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