Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!execu!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F. Haugh II) Newsgroups: comp.unix.internals Subject: Re: Checking Exit Codes Message-ID: <18701@rpp386.cactus.org> Date: 7 Nov 90 07:18:54 GMT References: <18689@rpp386.cactus.org> <4460@segue.segue.com> Reply-To: jfh@rpp386.cactus.org (John F. Haugh II) Organization: Lone Star Cafe and BBS Service Lines: 42 X-Clever-Slogan: Recycle or Die. In article <4460@segue.segue.com> jim@segue.segue.com (Jim Balter) writes: >In article <18689@rpp386.cactus.org> jfh@rpp386.cactus.org (John F. Haugh II) writes: >>as i said, it was a fake example. you pay your money, you take your chances. > >I hope no one is paying you money for your advice. well, there appears to be some confusion. it is not my "opinion" or my "advice" that assert() may return, but rather a statement of reality. like it or not, on certain machines signal (SIGIOT, SIG_IGN); assert (0 == 1); puts ("this will never print out"); WILL print out. i don't have to agree with it or disagree with it or like it or not - it is simply a statement of fact. furthermore, the statement that assert() prints an error and then calls abort() is likewise false. if your application (for example, debugging) =expects= that assert(FALSE) generate a core dump due to abort() being called, you are making an assumption that does not take into account every perverse implementation of assert() ever made - including a very popular unix-derivative from microsoft called "xenix". again, i neither have to agree or disagree that this is a good idea - i am simply reporting a fact. > And whether abort dumps core >or not is an issue outside the ANSI C standard and is hardly a portability >issue. Once you get an assert failure; it is time to debug; you can force all >the core dumps you want. there are more compilers in this world that ANSI C compilers. if you want to pretend ANSI C is the only C language out there, then of course "assert" always gives the expected result. i mean, in a perfect world everything is perfect. i have to use at least 3 different C compilers every day. i don't have the luxury of assuming every C compiler is ANSI compliant. -- John F. Haugh II UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 832-8832 Domain: jfh@rpp386.cactus.org "SCCS, the source motel! Programs check in and never check out!" -- Ken Thompson