[Issue 3053] cross imports produce repeated calls to a call destructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 21 18:21:35 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3053



--- Comment #2 from brauningbar at gmail.com 2010-12-21 18:19:38 PST ---
(In reply to comment #1)
> Cannot reproduce on Windows. Tried several compiler versions, including 2.030
> and 2.050.
> Compiled with noflags, and with -O, -unittest. Tried compiling obj files
> seperately. Tried all 6 combinations of ordering on the command line.
> In every case, there was only one destructor call.
> 
> Can someone reproduce this on Linux?

THIS IS A SESSION SHOWING THE BUG in linux. 
The 2.050 doesn't emit bug but 2.039. I hope this is util
----------------------------------------------------------

solved> cd ttttt
ttttt> ls
expresion.d  makefile  newdawk.d  programa.d
ttttt> dmd | head -1
Digital Mars D Compiler v2.050
ttttt> make
dmd  -ofnewdawk *.d
ttttt> newdawk 
dtor
ttttt> cd ../ttttt_on_dmd2.039/
ttttt_on_dmd2.039> make
~/comp/D/dmd2.039/linux/bin/dmd  -ofnewdawk *.d
    deferring sigaction_t
ttttt_on_dmd2.039> newdawk 
dtor
dtor
dtor
dtor
dtor
dtor
ttttt_on_dmd2.039> ls
expresion.d  makefile  newdawk  newdawk.d  newdawk.o  programa.d
ttttt_on_dmd2.039> cat newdawk.d 
import programa;

void main()
{
    auto prog = new Programa(); 
}
ttttt_on_dmd2.039> cat programa.d 
import std.stdio;
import expresion;

class Programa 
{
Function fun;    

   ~this()
    {
        writefln("dtor");
    }
}
ttttt_on_dmd2.039> cat expresion.d 
import programa;

struct Function
{
}
ttttt_on_dmd2.039> 





ttttt_on_dmd2.039> make clean
rm newdawk *.o ; true
ttttt_on_dmd2.039> grep ARGS= makefile 
DARGS=
ttttt_on_dmd2.039> vi makefile 
skipping 15 old session files
reading makefile

wrote makefile, 11 lines, 139 chars
ttttt_on_dmd2.039> grep ARGS= makefile 
DARGS=-unittest
ttttt_on_dmd2.039> make
~/comp/D/dmd2.039/linux/bin/dmd -unittest -ofnewdawk *.d
    deferring sigaction_t
ttttt_on_dmd2.039> newdawk 
dtor
dtor
dtor
dtor
dtor
dtor
dtor
dtor
dtor
dtor
dtor
dtor
dtor
dtor
ttttt_on_dmd2.039> 



ttttt_on_dmd2.039> cat /etc/slackware-version 
Slackware 13.1.0
ttttt_on_dmd2.039> gcc --version
gcc (GCC) 4.4.4
Copyright (C) 2010 Free Software Foundation, Inc.
Esto es software libre; vea el código para las condiciones de copia.  NO hay
garantía; ni siquiera para MERCANTIBILIDAD o IDONEIDAD PARA UN PROPÓSITO EN
PARTICULAR

ttttt_on_dmd2.039> ld --version
GNU ld (Linux/GNU Binutils) 2.20.51.0.8.20100412
Copyright 2010 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
ttttt_on_dmd2.039> uname -a
Linux slackweiller 2.6.33.4-MEMOPRESARIO #14 SMP Mon Nov 15 01:13:57 AKST 2010
i686 AMD Sempron(tm) SI-42 AuthenticAMD GNU/Linux

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list