mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

Fixes https://github.com/dlang/dmd/issues/20423 Ultimate cause of this issue was that va_arg was being shadowed by the collected template-like macros. As va_arg is not a normal function (it takes a type as a parameter), this interfered with the cparser's rewrite of va_arg to a call to the single argument template version in core.stdc.stdarg.
18 lines
361 B
C
18 lines
361 B
C
// https://github.com/dlang/dmd/issues/20423
|
|
#include <stdarg.h>
|
|
#include <stddef.h>
|
|
#include <assert.h>
|
|
|
|
void foo(double * pm, ...) {
|
|
va_list ap;
|
|
double * targ;
|
|
va_start(ap, pm);
|
|
for (int i=1; ; i++) {
|
|
va_arg(ap, int);
|
|
targ = va_arg(ap, double*);
|
|
if (targ == NULL) {
|
|
break;
|
|
}
|
|
}
|
|
va_end(ap);
|
|
}
|