Wednesday, May 23, 2012

Nimrod programming language

Very interesting language, spotted when looking for Vala (generates C code) -)

Monday, May 21, 2012

Monday, May 14, 2012

Dangerous C++ preprocessor

It took me three weeks to find this mistake in a huge code base. Program suddenly crashes after the changes  that look obviously innocent. And the root of all evil was not memory leaks or so but the #ifdef.


struct mystruct : somebasestruct {

#ifdef FEATURE_X

int somefield;




#include ....
#include "header.h"

sizeof(mystruct) = 8


#include ....
#include "header.h"

sizeof(mystruct) = 4

And guess why? Yes, check building settings, what is defined or not...