Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » serious mingw bug?
serious mingw bug? [message #16195] Sun, 01 June 2008 17:48 Go to previous message
hojtsy is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Ideas for an SVN addition to theide
Next Topic: Task: How to read GTK/Gnome settings
Goto Forum:
  


Current Time: Sat Apr 27 07:31:57 CEST 2024

Total time taken to generate the page: 0.04545 seconds