Article View: comp.std.c
Article #1655Re: ANSI assert
From: Henry Spencer
Date: Sun, 09 Sep 1990 01:05
Date: Sun, 09 Sep 1990 01:05
19 lines
972 bytes
972 bytes
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
Technical Details
Message-ID:
<1990Sep9.010514.26911@zoo.toronto.edu>Path:
arc1-ca.pugleaf.net!utzoo!henryReferences:
<1428@proto.COM>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!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