[geos-devel] assert.h / assert()

strk at refractions.net strk at refractions.net
Tue Jan 31 18:39:35 EST 2006

On Tue, Jan 31, 2006 at 06:31:23PM -0500, Stephen Woodbridge wrote:
> strk at refractions.net wrote:
> >Is there any known problem in using assert.h with GEOS ?
> >I'm asking as I know there have been issues with stdio.h
> >in the past, but I'd like to be able using assert()
> >or any equivalent standard C++ thing to easy debugging.
> Why not wrap is in a #define like
> #ifdef DEBUG
> #define ASSERT(x) assert(x)
> #else
> #define ASSERT(x)
> #endif
> or something like that. Then it is easy to add it to the source but 
> exclude when required.

assert() is a macro, you exclude it by defining NDEBUG.


More information about the geos-devel mailing list