www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 1949] New: Remove internal dependency on stdarg

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1949

           Summary: Remove internal dependency on stdarg
           Product: DGCC aka GDC
           Version: 0.24
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn users.sf.net
        ReportedBy: larsivar igesund.net


Use of varargs does not work in GDC unless the necessary symbols from
gcc.builtins are imported via std.stdarg. This check happens in

void d_gcc_magic_module(Module *m)

in d-builtins2.cc

This means that Tango (and all other runtime libraries for D) needs to have
std.stdarg, even if this leads to an obvious conflict if one is to try to
install two such libraries at the same time (Tango and Tangobos is a typical
example that is affected by this.)

I can see no reason why gcc.builtins (which also is hardcoded into the magic
function above) should be the only required module to have varargs working. An
alternative would be adding tango.core.Vararg, but that would be an equally
broken solution.

Another solution proposed by Bommel, was that the dependency on gcc.builtins
could also be removed, by using a pragma to register the required symbols with
the compiler. Probably more work though.


-- 
Mar 26 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1949






Alternatively, one could allow the stdarg import to come from
somewhere else, something like 'gcc.stdarg' might be a good fit.

That would be a fairly trivial change, just changing the line:

else if (md->packages->dim >= 1 && !strcmp( ((Identifier *)
md->packages->data[0])->string, "std" ))

To also strcmp for "gcc" would allow for std.stdarg, gcc.stdarg,
std.c.stdarg, or gcc.c.stdarg, which seems reasonable and would be a
very simple way to resolve this problem without introducing pragmas or
some other (though possibly more flexible) complex solution.


-- 
Mar 26 2008
prev sibling next sibling parent Fawzi Mohamed <fmohamed mac.com> writes:
On 2008-03-26 22:47:41 +0100, d-bugmail puremagic.com said:

 http://d.puremagic.com/issues/show_bug.cgi?id=1949
 
            Summary: Remove internal dependency on stdarg
            Product: DGCC aka GDC
            Version: 0.24
           Platform: Other
         OS/Version: All
             Status: NEW
           Severity: major
           Priority: P2
          Component: glue layer
         AssignedTo: dvdfrdmn users.sf.net
         ReportedBy: larsivar igesund.net
 
 
 Use of varargs does not work in GDC unless the necessary symbols from
 gcc.builtins are imported via std.stdarg. This check happens in
 
 void d_gcc_magic_module(Module *m)
 
 in d-builtins2.cc
 
 This means that Tango (and all other runtime libraries for D) needs to have
 std.stdarg, even if this leads to an obvious conflict if one is to try to
 install two such libraries at the same time (Tango and Tangobos is a typical
 example that is affected by this.)
I was able to fix at least the issue with tango and tangobos removing the (superfluos) import of std.compat from tangobos std.stdarg. So the severity is not so major :) Fawzi
 I can see no reason why gcc.builtins (which also is hardcoded into the magic
 function above) should be the only required module to have varargs working. An
 alternative would be adding tango.core.Vararg, but that would be an equally
 broken solution.
 
 Another solution proposed by Bommel, was that the dependency on gcc.builtins
 could also be removed, by using a pragma to register the required symbols with
 the compiler. Probably more work though.
Apr 01 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1949


fawzi gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lugaidster gmail.com,
                   |                            |fawzi gmx.ch





I was able to remove the issue with tango and tangobos removing the
(unnecessary) import std.compat from tangobos std.stdarg .
So the severity is less important.


-- 
Apr 01 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1949






I don't think it is less important - even if it solves the particular problem
leading up to this report. 


-- 
Apr 01 2008