Skip to content

Should JNA promote float vararg arguments to double? #463

Closed
@marco2357

Description

@marco2357

C seems to require promoting of float vararg arguments to double:

include <stdarg.h>

void foo(int bar, ...) {
va_list baz;
va_arg(baz, float);
}

GCC says:
warning: ‘float’ is promoted to ‘double’ when passed through ‘...’
note: (so you should pass ‘double’ not ‘float’ to ‘va_arg’)
note: if this code is reached, the program will abort

JNA doesn't promote vararg floats. Should users do this themselves or should JNA be changed? I think it would be better if JNA was handling this because it's very hard to debug. What do the JNA maintainers think?

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