[Issue 15417] Wrong parameter passing for variadic nested functions within aggregate

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Dec 8 02:16:24 PST 2015


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

Iain Buclaw <ibuclaw at gdcproject.org> changed:

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

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject.org> ---
If only dmd warned you against bad code:

---
$ gdc valist.d 
valist.d: In function ‘test’:
valist.d:10:13: warning: second parameter of ‘va_start’ not last named argument
[-Wvarargs]
             va_start(ap, _argptr);
             ^
---

Use `va_start(ap, c1);'

Besides, if _argptr isn't initialized properly (it segfaults when you use it
directly) that is a bug.

--


More information about the Digitalmars-d-bugs mailing list