[Issue 22960] importC: K&R-style functions assume variadic calling convention

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 30 09:05:32 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22960

Iain Buclaw <ibuclaw at gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at gdcproject.org

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Walter Bright from comment #1)
> I don't really understand this.
> 
>     int printf();
> 
> is variadic. All K+R functions are variadic.
I guess the difference is whether the body of `other` has code generated as-if
it is variadic.

Yes, variadic in the sense of "we accept any number of arguments to be called
to us".  But not variadic in that those extraneous arguments are ever read by
the callee.

--


More information about the Digitalmars-d-bugs mailing list