Fucking GCC horror stories
Posted: Sun Jul 04, 2010 4:00 pm
Code: Select all
#ifndef TEST_H
#define TEST_H
#include "qdebug.h"
class test
{
public:
test();
test* getInstance(){return NULL;}
void doShit() { int x=3; qDebug()<<x;}
};
#endif // TEST_H
Code: Select all
test a;
test* instance=(test*)a.getInstance();
instance->doShit();
Also, there was a point where i was doing this:
Code: Select all
bool Level::areaExists(QString) {
for(int i=0;i<areaList.size();i++) {
if(name.compare(areaList[i]->getName(),Qt::CaseInsensitive) == 0) {
return true;
}
}
return false;
}
Granted, I should not be using the same name for the parameter and private memeber...But still. That is fucking bullshit that GCC would allow me to do that. I literally spent HOURS on gcc's fucking bullshit lack of errors, and I'm pissed.
OH, and here's another:
Add this to the above test.h:
Code: Select all
bool doMoreShit() {/*k, what?*/}
Code: Select all
if(instance->doMoreShit()) /*what happens here?*/;