Bug 22307 – importC: unable to parse __builtin_va_arg

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-09-14T21:18:04Z
Last change time
2021-09-28T06:20:56Z
Keywords
ImportC
Assigned to
No Owner
Creator
dave287091
See also
https://issues.dlang.org/show_bug.cgi?id=21974

Comments

Comment #0 by dave287091 — 2021-09-14T21:18:04Z
Consider the following preprocessed program using varargs. typedef __builtin_va_list va_list; int add_nums(int count, ...) { int result = 0; va_list args; __builtin_va_start(args, count); for (int i = 0; i < count; ++i) { result += __builtin_va_arg(args, int); // Error: expression expected, not `int` } __builtin_va_end(args); return result; } __builtin_va_arg is unusual, looking like a function, but taking a type as the second argument.
Comment #1 by bugzilla — 2021-09-28T06:20:56Z
*** This issue has been marked as a duplicate of issue 21974 ***