Home » Developing U++ » U++ Developers corner » serious mingw bug?
serious mingw bug? [message #16195] |
Sun, 01 June 2008 17:48 |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
I am using U++ 2008.1beta2 with the embedded MinGW 4.3.0 on WinXp sp2.
I think I have found a code generation bug in MinGW for this code:
#include <Core/Core.h>
struct Test
{
Test() { Upp::Cout() << "Test::Test()\n"; }
~Test() { Upp::Cout() << "Test::~Test()\n"; }
};
struct Worker
{
Worker * Fn1()
{
bool throwException = false;
bool enterLoop = true;
for(Test t; enterLoop;)
{
if(throwException) throw int(3);
Upp::Cout() << "returning this = " << (void *) this << "\n";
return this;
}
}
int i;
};
CONSOLE_APP_MAIN
{
Worker w;
Upp::Cout() << "&w = " << (const void *) &w << "\n";
Worker *w2 = w.Fn1();
Upp::Cout() << "received = " << (const void *) w2 << "\n";
}
output is below. Notice that Fn1 incorrectly returns the null pointer. Both the non-invoked throw and the loop is important: if I remove any of them, the bug doesn't occur. Am I missing something? Wouldn't is be good idea to revert the included MinGW to a stable version?
&w = 0x12FF40
Test::Test()
returning this = 0x12FF40
Test::~Test()
received = 0x0
- hojtsy
[Updated on: Sun, 01 June 2008 18:00] Report message to a moderator
|
|
|
|
|
|
Re: serious mingw bug? [message #16282 is a reply to message #16218] |
Thu, 05 June 2008 23:12 |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
luzr wrote on Mon, 02 June 2008 16:26 | I guess this means we should update mingw from official mingw, correct?
|
Yes, if you have an older mingw version in U++. I don't know that from the version strings. How and when did you acquire the mingw that is part of latest U++ package?
- hojtsy
|
|
|
Goto Forum:
Current Time: Fri Sep 20 05:01:23 CEST 2024
Total time taken to generate the page: 0.03316 seconds
|