Skip to content

Vararg functions does not compile on x86_64 #702

@redstar

Description

@redstar

The following module

import core.vararg;
import core.stdc.stdio;

void log(const(char)* str, ...)
{
    va_list args;
    version(LDC)
        va_start(args, str);
    else
        va_start(args, __va_argsave);
    vprintf(str, args);
    va_end(args);
}

void main()
{
    log("%d %d %d\n", 1, 2, 3);
}

compiles with dmd but gives an error with ldc:

ldc_github.d(11): Error: function core.stdc.stdio.vprintf (const(char*) format, __va_list* arg) is not callable using argument types (const(char)*, void*)

Only on x86_64. The implementation of core.vararg is wrong.

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