Skip to content
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

std::ffi::VaList does not match esp_idf_sys::va_list #239

Closed
jothan opened this issue Oct 19, 2024 · 0 comments
Closed

std::ffi::VaList does not match esp_idf_sys::va_list #239

jothan opened this issue Oct 19, 2024 · 0 comments

Comments

@jothan
Copy link

jothan commented Oct 19, 2024

I tried this code:

extern "C" {
    fn vsnprintf(s: *mut c_char, n: usize, format: *const c_char, ap: VaList) -> c_int;
}

Calling the above function with this signature crashes.

Instead, replacing VaList with VaListImpl works.

extern "C" {
    fn vsnprintf(s: *mut c_char, n: usize, format: *const c_char, ap: VaListImpl) -> c_int;
}

The underlying issue seems that VaList should contain 3 u32 fields instead of being single pointer sized.

Details in PR #238

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (02368e90f 2024-09-03) (1.81.0.0)
binary: rustc
commit-hash: 02368e90f28c216258b47072a65cb6b4991fc0ed
commit-date: 2024-09-03
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 17.0.1
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants