www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - dmc 8.40.2n introduces a problem with stlsoft rectarr.cpp

reply Mario <Mario_member pathlink.com> writes:
Hi,

the update from dmc 8.38.9n to 8.40.2n introduced a problem with the stlsoft
example form ddj rectarr.cpp. Just in case I have added th file ...

In both cases it's the same stlsoft lib which comes with the 8.38 CD version.
Only the compiler was updated.

D:\mario\src\cc\palooza\speed4>dmc -DSTRINGTOK_STLSOFT -o+speed -Id:\mario\dm\st
lsoft -odmc_rectarr.exe rectarr.cpp
link rectarr,dmc_rectarr.exe,,user32+kernel32/noi;

Digital Mars C/C++ Compiler Version 8.38.9n
Copyright (C) Digital Mars 2000-2003.  All Rights Reserved.
Written by Walter Bright
www.digitalmars.com

C:\mario\src\cc\palooza\speed4>dmc -DSTRINGTOK_STLSOFT -o+speed
-Ic:\mario\dm\stlsoft -odmc_rectarr.exe rectarr.cpp
c:\mario\dm\stlsoft\stlsoft_iterator.h(675) : Error: function expected
Internal error: template 1902
--- errorlevel 1

Digital Mars C/C++ Compiler Version 8.40.2n
Copyright (C) Digital Mars 2000-2004.  All Rights Reserved.
Written by Walter Bright
www.digitalmars.com


Thanks in advance

-- Mario


begin 0644 rectarr.cpp
M+RH +R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\-"B`J($9I;&4Z
M"0ER96-T87)R+F-P<`T*("H-"B`J(%!U<G!O<V4Z"0E497-T('!R;V=R86T 
M9F]R(%)E8W1A;F=U;&%R(&%R<F%Y<PT*("H-"B`J($-R96%T960)"3$V=&  
M2G5N92`R,#`S#0H *B!5<&1A=&5D. D),C!T:"!*=6YE(#(P,#,-"B`J#0H 
M*B!#;W!Y<FEG:'0Z"5-Y;F5S:7, 4V]F='=A<F4 4'1Y($QT9"P *&,I(#(P
M,#,N($%L;"!R:6=H=', <F5S97)V960N#0H * T*("H 2&]M93H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*
M"0D)7U]35$Q33T947T-/35!)3$527TQ!0D5,7U-44DE.1RP-" D)"6-O=6YT
M97(N9V5T7VUI;&QI<V5C;VYD<R I+`T*"0D)251%4D%424].4RP-" D)"40P
M+`T*"0D)1#$L#0H)"0E$,BP-" D)"71O=&%L*3L-" T*"7)E='5R;B`P.PT*
M?0T*#0HO+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
J+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+PT*
`
end
Mar 31 2004
parent reply "Matthew" <matthew stlsoft.org> writes:
Mario

I'm pretty sure this is a flaw with DMC++'s handling of static initialiser
objects (aka Schwarz Counter's). I've mentioned it before to Walter, and
there was a workaround built into various headers - look for
s_performance_counter_class_constructor in winstl_performance_counter.h -
but it looks like 8.40 makes the problem even worse, as the workaround no
longer works at all.

If I can isolate it down sufficiently, I'll post a sample bug on the C++
newsgroup, and hopefully a fix can go in 8.41.

For the moment, the answer is simply to comment out both definitions of
s_performance_counter_class_constructor in winstl_performance_counter.h.
(There's also a similar use of initialisers in
winstl_high_performance_counter.h.)

Cheers

Matthew


"Mario" <Mario_member pathlink.com> wrote in message
news:c4e9kp$1acb$1 digitaldaemon.com...
 Hi,

 the update from dmc 8.38.9n to 8.40.2n introduced a problem with the
stlsoft
 example form ddj rectarr.cpp. Just in case I have added th file ...

 In both cases it's the same stlsoft lib which comes with the 8.38 CD
version.
 Only the compiler was updated.
D:\mario\src\cc\palooza\speed4>dmc -DSTRINGTOK_STLSOFT -o+speed -Id:\mario\d m\st
 lsoft -odmc_rectarr.exe rectarr.cpp
 link rectarr,dmc_rectarr.exe,,user32+kernel32/noi;

 Digital Mars C/C++ Compiler Version 8.38.9n
 Copyright (C) Digital Mars 2000-2003.  All Rights Reserved.
 Written by Walter Bright
 www.digitalmars.com

 C:\mario\src\cc\palooza\speed4>dmc -DSTRINGTOK_STLSOFT -o+speed
 -Ic:\mario\dm\stlsoft -odmc_rectarr.exe rectarr.cpp
 c:\mario\dm\stlsoft\stlsoft_iterator.h(675) : Error: function expected
 Internal error: template 1902
 --- errorlevel 1

 Digital Mars C/C++ Compiler Version 8.40.2n
 Copyright (C) Digital Mars 2000-2004.  All Rights Reserved.
 Written by Walter Bright
 www.digitalmars.com


 Thanks in advance

 -- Mario
Apr 11 2004
parent Scott Michel <scottm mordred.cs.ucla.edu> writes:
In c++ Matthew <matthew stlsoft.org> wrote:
 Mario
 
 I'm pretty sure this is a flaw with DMC++'s handling of static initialiser
 objects (aka Schwarz Counter's). I've mentioned it before to Walter, and
 there was a workaround built into various headers - look for
 s_performance_counter_class_constructor in winstl_performance_counter.h -
 but it looks like 8.40 makes the problem even worse, as the workaround no
 longer works at all.
I wasn't really able to parse the bug here, but if it's something along the lines of "static objects don't get constructed", e.g.: ---- myfile.cxx ---- #include <iostream> struct wombat { wombat(int c_arg) { std::cout << "wombat ctor, carg = " << c_arg << std::endl; } ~wombat() { }; }; static wombat private_marsupial_thingy(1); ---- end of file ---- In the 8.38 compiler, "wombat ctor, carg = 1" wasn't printed b/c static objects' ctors didn't get called. The workaround is to use anonymous namespaces, e.g.: namespace { wombat private_marsupial_thingy(1); }; or upgrade to 8.39. -scooter
Apr 12 2004