digitalmars.D.bugs - [Issue 937] New: C-style variadic functions broken
- d-bugmail puremagic.com (51/51) Feb 07 2007 http://d.puremagic.com/issues/show_bug.cgi?id=937
- d-bugmail puremagic.com (5/5) Feb 09 2007 http://d.puremagic.com/issues/show_bug.cgi?id=937
- d-bugmail puremagic.com (5/5) Feb 09 2007 http://d.puremagic.com/issues/show_bug.cgi?id=937
- d-bugmail puremagic.com (20/20) Aug 26 2010 http://d.puremagic.com/issues/show_bug.cgi?id=937
- d-bugmail puremagic.com (13/13) Feb 20 2011 http://d.puremagic.com/issues/show_bug.cgi?id=937
http://d.puremagic.com/issues/show_bug.cgi?id=937
Summary: C-style variadic functions broken
Product: D
Version: 1.005
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: rejects-valid
Severity: major
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: tomas famolsen.dk
The code below should explain the problem sufficiently:
-------------------------------------------------------
module vararg;
// Works
void a(...)
{
void* v = _argptr;
}
// Works
void b(char* fmt, ...)
{
void* v = _argptr;
}
// Error: variadic functions with non-D linkage must have at least one
parameter
// which is correct
extern(C)
void c(...)
{
void* v = _argptr;
}
// Error: undefined identifier _argptr
// vararg.d(22): Error: cannot implicitly convert expression (_argptr) of type
int to void*
// this is contrary to spec!
extern(C)
void d(char* fmt, ...)
{
void* v = _argptr;
}
void main()
{
a("a", 2, 3.0);
b("b", 2, 3.0);
c("c", 3, 3.0);
d("c", 3, 3.0);
}
--
Feb 07 2007
http://d.puremagic.com/issues/show_bug.cgi?id=937 I don't think this is a bug. For extern(C) you need std.c.stdarg, va_start..va_end.. --
Feb 09 2007
http://d.puremagic.com/issues/show_bug.cgi?id=937 According to the spec the _argptr variable should be available... So it most definitely is! --
Feb 09 2007
http://d.puremagic.com/issues/show_bug.cgi?id=937
Dan G. <venix1 gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |venix1 gmail.com
While working on GDC, it was found this bug still exists in 1.063.
The problem appears to be an if statement in func.c around line 811.
"parameters" is not initialized until further down in the function. By
substituting "f->parameters" the problem is resolved.
-----------------------------------------------------------
// Original if statement
if (f->linkage == LINKd || (parameters && parameters->dim))
// Modified if statement
if (f->linkage == LINKd || (f->parameters && Parameter::dim(f->parameters)))
GDC ticket.
http://bitbucket.org/goshawk/gdc/issue/57/c-style-variadic-functions-broken
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 26 2010
http://d.puremagic.com/issues/show_bug.cgi?id=937
Walter Bright <bugzilla digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |bugzilla digitalmars.com
Resolution| |FIXED
13:11:53 PST ---
https://github.com/D-Programming-Language/dmd/commit/888bd52ab4d07c132c38f231dfabea648bf94cba
https://github.com/D-Programming-Language/dmd/commit/8d2bf812530f51b40fe08c9b0f526b60575ae604
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 20 2011









d-bugmail puremagic.com 