//TODO: professional stuff of software engineer 1001010
Tag Archives: bug
Testing a C/C++ plugin to do syntax highlighting

Got a new wordpress plugin from http://alexgorbatchev.com/SyntaxHighlighter/, let’s see how it works, by drawing on a recent facepalm bug that existed for many years in the codebase..

#ifdef linux
struct SomePThreadContainer {
	pthread_mutex_t mutex;
	int other_data[32];
};
#define ODD_DATA_SIZE sizeof(SomePThreadContainer)
#else
#define ODD_DATA_SIZE sizeof(HANDLE)
#endif
class OddWrapper {
	byte m_oddAbsraction[ODD_DATA_SIZE];
public:
	void DoStuff();
};
class OddContainer {
	OddWrapper oddOne;
	bool b1;
	OddWrapper oddTwo;
public:
	void VerifyOneWorksOnUse();
	void VerifyTwoFailsOnUse(); // but will work if b1 is changed from a bool to an int
};

Many bothans were NEEDLESSLY lost to bring you this bug. 🙂