Op 5 nov. 2011 22:58 schreef "K. Frank" <[email protected]> het volgende:
>
> Hi Kai!
>
> On Sat, Nov 5, 2011 at 3:20 PM, Kai Tietz <[email protected]> wrote:
> > 2011/11/5 K. Frank <[email protected]>:
> >> Hello Everyone!
> >>
> >> I see the same behavior on a couple of other mingw-w64 versions.
> >> ...
> >> Okay, I tried this on two more compiler versions, and I get the same
> >> result, namely that the loop seems to "exit" early.
> >>
> >> These are two Ozkan Sezer builds: 4.4.5 and 4.5.2:
> >>
> >>   g++ (GCC) 4.4.5 20101001 (release) [svn/rev.164871 - mingw-w64/oz]
> >>   g++ (GCC) 4.5.2 20101002 (prerelease) [svn/rev.164902 - mingw-w64/oz]
> >>
> >> I compile as follows:
> >>
> >>   g++ -g -o stdout_stream_error stdout_stream_error.cpp
> >>
> >> and the program gives the same output as before, namely:
> >>
> >>   C:\>stdout_stream_error
> >>   hello...
> >>   xsputn: top of loop, pos = 0
> >>   Message 1 (with '\n')...
> >>   xsputn: bottom of loop, pos = 24
> >>   xsputn: top of loop, pos = 24
> >>   goodbye!
> >>
> >> Now I will say that seeing the same behavior in several versions of the
> >> compiler does make it a little less likely that it's a compiler bug,
on the
> >> theory that such a bug would already have been noticed and fixed.
> >>
> >> Nonetheless, I am sticking with my analysis, and I think there is a bug
> >> in the compiler.
> >>
> >> Best.
> >>
> >> K. Frank
> >
> > The only thing it might could be here, is that erase-call raises an
> > exception, but why you see the goodbye message here than?
>
> Yes, I had thought of the exception possibility (although, as you say,
> it doesn't really make sense because of the goodbye message).  So
> I actually put a try block in my test program (in main):
>
>    // prints only "Message 1" to text1
>    try {
>      std::cout << "Message 1 (with '\\n')...\n";
>      std::cout << "Message 2 (with '\\n')...\n";
>    }
>    catch (...) {  // no exception thrown -- not the ptoblem
>      printf ("exception caught...\n");
>    }
>
> The try wraps the calls to operator<< that trigger the calls to xsputn,
> so this would seem to show that no exception is being thrown (as no
> "exception caught" message is being printed out).

I would take this to stackoverflow.com, try to reduce the code a bit
further... There's a lot of language lawyers there that should be able to
formulate a correct answer if asked the right question. Be concise but
complete ;-)

Ruben
>
> > Kai
>
> Thanks.
>
>
> K. Frank
>
>
------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to