C assertions

The assert method is a very useful debugging macro for C/C++. It’s great when developing code that other people will be using and extending, to ensure that someone doesn’t do something unintentional. In cases like this, a useful assert(0) will spew an error and abort the instance of the application. It tells the developer “oops: you did something wrong”. Yes, it can be confusing to some developers, and it’s even worse when a user sees it (insert boring rant about the necessity of good breadth testing). But when used well, I quite like it.

At work I’m using the LSB C++ compiler to build our latest product for all Linux Standards Base platforms. I’ve written about how the compiler is buggy before (at least I meant to..), but this time it’s an issue in the assert.h header that ships with the LSB SDK: it’s completely broken.

The macro doesn’t work properly whatsoever.

It’s rather frustrating when something like that is so utterly broken. The only good news is that the LSB folks are taking the bug rather seriously.

Comments are closed.