Re: BUG REPORT: Cygwin, g++, -O2, static member function, std::string

2007-10-24 Thread Christopher Faylor
On Wed, Oct 24, 2007 at 12:21:27PM -0700, Robert P. Goddard wrote: > This is a reply to the message Yo! Just reply to the message. You don't have to announce that you're doing it. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/pr

Re: BUG REPORT: Cygwin, g++, -O2, static member function, std::string

2007-10-24 Thread Lewis Hyatt
Can you post the bug{1,2}.cpp files? I would guess that its not a bug, but rather you are relying on an undefined order of static initialization that happens to do what you want sometimes but not others. It's impossible to say for sure without seeing the source files, though. Oh I see, you di

Re: BUG REPORT: Cygwin, g++, -O2, static member function, std::string

2007-10-24 Thread Robert P. Goddard
This is a reply to the message http://cygwin.com/ml/cygwin/2007-10/msg00509.html: The linker is supposed to resolve a function-local static variable into one exactly one instance, constructed on the first call, even if the function is expanded in-line from multiple compilation units. It seems

BUG REPORT: Cygwin, g++, -O2, static member function, std::string

2007-10-24 Thread Brad Bell
-- #! /bin/bash # echo "BUG REPORT: Cygwin, g++, -O2, static member function, std::string" echo "RUN COMMAND: $0 $*" echo "RESULT: assertion \"r != 0\" failed" echo "SIDE EFFECTS: the files ./bug0.hpp, bug1.cpp, a

Re: BUG REPORT: Cygwin, g++, -O2, static member function, std::string

2007-10-24 Thread Lewis Hyatt
Brad Bell wrote: I seem to have run across a bug using g++ with -O2 under Cygwin. It has to do with using static class member functions and standard string. The bash shell script command ./bug.sh creates three files, compiles, links, and runs the result. I have run this command on severa

BUG REPORT: Cygwin, g++, -O2, static member function, std::string

2007-10-24 Thread Brad Bell
p bug2.cpp -O2 -o bug ./bug assertion "r != 0" failed: file "bug2.cpp", line 8 11 [sig] bug 1924 C:\cygwin\home\Brad\trash\bug.exe: *** fatal error - call ed with threadlist_ix -1 ./bug.sh: line 58: 1924 Hangup ./bug BUG REPORT: Cygwin, g++, -O2, static me