Skip to content

va_start type mismatch #1353

@Rua

Description

@Rua

When transpiling this C code

void I_Error (char *error, ...)
{
    va_list argptr;
    va_start (argptr,error);

the following code is emitted

#[no_mangle]
pub unsafe extern "C" fn I_Error(mut error: *mut std::ffi::c_char, mut args: ...) {
    let mut argptr: va_list = 0 as *mut std::ffi::c_char;
    argptr = args.clone();

The last line creates a compile error, because args is a Rust type, std::ffi::VaListImpl, and doesn't match the type of argptr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions