From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,279217ad1d03b7ad X-Google-Attributes: gidf8c9b,public X-Google-Thread: 1020c6,279217ad1d03b7ad X-Google-Attributes: gid1020c6,public X-Google-Thread: fee84,279217ad1d03b7ad X-Google-Attributes: gidfee84,public From: dsr@lns598.lns.cornell.edu (Daniel S. Riley) Subject: Re: What do you think of osf/1? Date: 1995/06/27 Message-ID: #1/1 X-Deja-AN: 105130564 references: <3rst5b$i3c@news1.WING.NET> organization: Wilson Lab, Cornell U., Ithaca, NY 14853 newsgroups: comp.unix.osf.osf1,comp.unix.admin,comp.unix.questions In article Dan.Pop@mail.cern.ch (Dan Pop) writes: Dan.Pop> assert() is, by definition, for those problems that are fixed Dan.Pop> before the product is shipped. An assertion is not "for" a particular problem at all, it is an assertion that a particular condition is true. The proper use is to assert that a program invariant has not been violated. assert() should be the early warning system for unknown bugs, not a test for a particular problem. For development tools like ld, I would *much* rather have assertions enabled--if ld has a bug, I'd rather get an immediate indication than have to track down an obscure corruption in the resulting executable. Dan.Pop> If the developer cannot be sure that he managed to do this Dan.Pop> before shipping, he will replace assert() with proper error Dan.Pop> detection and reporting code. Joe User should _never_ see Dan.Pop> something looking like "assertion failed...". So DEC should redefine assert to print out a polite error message? I fail to see how that does any good--it is still an incomprehensible error message. Whether it says "assertion failed" followed by some gibberish or "A fatal error has occurred, please submit an SPR to DEC with this information" followed by some gibberish makes little difference to me. Replacing every "assert()" with a more informative message would be a waste of engineering time, and a undesirable impediment to free use of assert(). -- Dan Riley Internet: dsr@lns598.lns.cornell.edu Wilson Lab, Cornell University HEPNET/SPAN: lns598::dsr (44630::dsr) "Distance means nothing/To me." -Kate Bush