X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Lewis Hyatt <lhyatt@princeton.edu>
Subject:  Re: BUG REPORT:   Cygwin, g++, -O2, static member function, std::string
Date:  Wed, 24 Oct 2007 14:35:19 -0400
Lines: 22
Message-ID: <ffo392$9da$1@ger.gmane.org>
References:  <Pine.LNX.4.64.0710241031500.24456@snark.apl.washington.edu>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
In-Reply-To: <Pine.LNX.4.64.0710241031500.24456@snark.apl.washington.edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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 several Cygwin systems and gotten results similar to 
> those in bug_cygwin.out; i.e., the assert
>     assertion r != 0 failed
> I have run the same command on several Linux systems and gotten results 
> similar to those in bug_linux.out; i.e., no assertion.
> 

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.

-Lewis


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

