Path: 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 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.)