Made to Order Software Corporation Logo

language

The assert() macro in C/C++

 

This is a subject that comes back all the time in C/C++ boards.

Should you use assertions?

The answer is clearly yes. But the C/C++ assert() function is usually defined using a macro. Macros have several problems. The most common ones are: they offer no type checking, they do not warn you about weird side effects, they have a different syntax than the C/C++ language itself.

One good thing: for a fast program, the debug code used to check parameters, results, etc. is gone.

One really bad thing: if the expression in the macro has a side effect, the release program is different from ...

New Professional Developer Tools

Made to Order Software Corporation is proud to present three new products, announced at the Linux on Wall Street conference in New York City, New York!

  • molib™

A robust application toolkit library, molib gives you the power to develop cross-platform applications quickly and easily. It abstracts operating system calls through C++ objects (i.e. moFile and moDirectory abstract access to the file system, moDatabase to a database of your choice and moApplication to the system environment). This lets you write code once to create applications which compile and ...