C Board  

Go Back   C Board > Community Boards > General Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 09-30-2009, 09:53 AM   #1
Registered User
 
Join Date: Nov 2007
Posts: 171
AAAAAAAAAAAHHHHH!!! (MinGW bugs)

A week and a half ago, I started a new personal project using mingw and so far I have encountered several bugs which produced incorrect compiled code.

So what I'll typically do in a case like this is make a copy of the file and starting paring it down in chunks to create the Smallest Compilable Example which Demonstrates the Problem (R).

But as some point, the code would start compiling correctly and so would the original code.

The example from yesterday that pushed me over the edge: What I originally wrote was something like this:
Code:
for (int i=n; i>=0; --i)
But the condition kept failing, and i kept decrementing into negative numbers. I changed it to
Code:
for (int i=n; i>-1; --i)
and it worked the way it was supposed to. I changed it back, and the same thing happened!

I copied the file and started deleting other methods and class variables without touching the offending part of the code, recompiling after every big chunk I deleted and at some point, it start working correctly. I recompiled the original code, and it worked too!

This is not the first time this has happened, and since I can't reproduce the problem, I can't even file a bug.

I just came on to complain and to say "Sayonara, GCC!"
__________________
I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo
NeonBlack is offline   Reply With Quote
Old 09-30-2009, 10:01 AM   #2
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 10,357
Which version of the MinGW port of GCC are you using? I noticed that the official 4.4.0 version is still pretty buggy.
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is online now   Reply With Quote
Old 09-30-2009, 10:39 AM   #3
l'Anziano
 
DavidP's Avatar
 
Join Date: Aug 2001
Posts: 2,573
hmm. I've never had any problems with bugs in GCC.
__________________
My Website

"Circular logic is good because it is."

Last edited by DavidP; 09-30-2009 at 10:45 AM.
DavidP is offline   Reply With Quote
Old 09-30-2009, 10:41 AM   #4
Registered User
 
Join Date: Nov 2007
Posts: 171
Hey laserlight. It's 4.3.3 from the package I downloaded here because I found that building boost was a PITA.

Looking closer at that site, I just realized that it includes the TDM GCC build. I did not notice that before. I had been using the previous version since last spring with no problems.

So maybe I'll try a previous version of the main build until it gives me problems.

Thanks! I wouldn't have seen that if I hadn't gone back to the site. (It said tdm in --version, but I ignored it as part of a huge meaningless string of letters )
__________________
I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo
NeonBlack is offline   Reply With Quote
Old 09-30-2009, 10:45 AM   #5
l'Anziano
 
DavidP's Avatar
 
Join Date: Aug 2001
Posts: 2,573
If you can get the bug to reproduce, you should immediately open up the assembly dump and post the assembly code here, 'cause I'd be interesting in seeing the assembly generated. You can do this by calling:

objdump -d [executable file name]

on the command line.
__________________
My Website

"Circular logic is good because it is."
DavidP is offline   Reply With Quote
Old 10-01-2009, 12:07 AM   #6
glo
Registered User
 
Join Date: May 2006
Posts: 155
Quote:
Originally Posted by NeonBlack View Post
for (int i=n; i>=0; --i)
You didn't say what n was, is it initialized? in which case, to what? and where?
glo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mingw and elcipse HELP Rob4226 Windows Programming 1 03-04-2008 01:35 AM
MinGW thread-safe runtime libraries Mario F. C++ Programming 3 08-21-2006 08:15 AM
Free compiler for commercial development? (mingw?) kook44 Windows Programming 8 01-07-2006 09:32 AM
compiling mingw to enable timeSetEvent underthesun Windows Programming 2 02-02-2005 06:00 PM
Need help fixing bugs in data parsing program daluu C Programming 8 03-27-2003 06:02 PM


All times are GMT -6. The time now is 04:13 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22