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:
But the condition kept failing, and i kept decrementing into negative numbers. I changed it toCode:for (int i=n; i>=0; --i)
and it worked the way it was supposed to. I changed it back, and the same thing happened!Code:for (int i=n; i>-1; --i)
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!"