Newsgroups: comp.std.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: ANSI assert
Message-ID: <1990Sep9.010514.26911@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <1428@proto.COM>
Date: Sun, 9 Sep 90 01:05:14 GMT

In article <1428@proto.COM> joe@proto.COM (Joe Huffman) writes:
>... I have many places in my code where I
>do something like the following:
>
>  assert(i++ < limit);

This is unwise, and has been from the start.  Many implementations of
<assert.h>, including the V7 one (the original, I think), do not evaluate
the operand at all when NDEBUG is defined.

The final ANSI C document, by the way, *specifically states* that when
NDEBUG is defined, assert() is defined as

	#define	assert(ignore)	((void)0)

and nothing else.
-- 
TCP/IP: handling tomorrow's loads today| Henry Spencer at U of Toronto Zoology
OSI: handling yesterday's loads someday|  henry@zoo.toronto.edu   utzoo!henry
