Article View: comp.std.c
Article #1666Re: ANSI assert
From: Doug Gwyn
Date: Sun, 09 Sep 1990 21:21
Date: Sun, 09 Sep 1990 21:21
11 lines
1088 bytes
1088 bytes
In article <159@thor.UUCP> scjones@thor.UUCP (Larry Jones) writes: >Code with side-effects in >an assert argument was generally agreed to be perverse at best. I don't know that it was "generally agreed"; one can reasonably argue either side of this issue from the point of view of programming. However, existing implementation practice was clearly on the side of not evaluating the argument in the NDEBUG case; by requiring that method of implementation, the standard guarantees wider usage of assert() than would be safe were it left undefined whether or not the argument is evaluated. (A previous poster gave an example of this.)
Technical Details
Message-ID:
<13780@smoke.BRL.MIL>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwynReferences:
<1428@proto.COM> <159@thor.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: ANSI assert Keywords: assert, NDEBUG Message-ID: <13780@smoke.BRL.MIL> Date: 9 Sep 90 21:21:14 GMT References: <1428@proto.COM> <159@thor.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 11