I have confirmed this problem disappears in Cygwin 2.8.2-1. Thanks.
On Wed, 12 Jul 2017 22:12:12 +0900 Takashi Yano <takashi.y...@nifty.ne.jp> wrote: > Hello. > > I have encountered a weird behaviour of g++ compiler. > > If the following code is compiled with -ansi -O flags, > the resulting executable causes core dump. > > This is caused only in 64 bit environment. In 32 bit > environment, it works as expected. > > $ cat str.cc > #include <string> > int main() > { > std::string s; > s = "ABC"; > return 0; > } > $ g++ -ansi -O str.cc -o str > $ ./str > Abort (core dumped) > $ > > Is this known problem? > > My environment is as follows. > > uname -a > CYGWIN_NT-10.0 Express5800-S70 2.8.1(0.312/5/3) 2017-07-03 14:11 x86_64 Cygwin > > g++ --version > g++ (GCC) 5.4.0 > Copyright (C) 2015 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > Thank you in advance. > > -- > Takashi Yano <takashi.y...@nifty.ne.jp> > > -- > Problem reports: http://cygwin.com/problems.html > FAQ: http://cygwin.com/faq/ > Documentation: http://cygwin.com/docs.html > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > -- Takashi Yano <takashi.y...@nifty.ne.jp> -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple