Article View: comp.sources.d
Article #2103Re: Multivol dumps core?
From: Larry Campbell
Date: Tue, 16 Dec 1986 03:45
Date: Tue, 16 Dec 1986 03:45
26 lines
1812 bytes
1812 bytes
In article <403@vixie.UUCP> paul@vixie.UUCP (Paul Vixie Esq) writes:
...
>In testdata.c, I found:
>
> if (no_eoln = (*argv[1] == '-' && *++argv[1] == 'n')) {
>
>Now, since C doesn't guarantee order of evaluation, this seems blatently
>wrong. I don't know neccessarily that this is the cause of my problem,
>but if the rest of the code has errors like this, I don't want to bother
>trying to find the cause of the core dumps. Mission: Impossible :-), and
>I refuse to accept it.
You are suffering from an all too common misconception. There are several
clearly documented operators for which the order of evaluation IS guaranteed,
and && is one of them. I quote from section 7.11 (pg. 190) of K&R:
Unlike &, && guarantees left-to-right evaluation; moreover
the second operand is not evaluated if the first operand is 0.
There may well be bugs in multivol, but the example quoted above isn't one
of them.
--
Larry Campbell The Boston Software Works, Inc.
Internet: campbell@maynard.bsw.com 120 Fulton Street, Boston MA 02109
uucp: {alliant,wjh12}!maynard!campbell +1 617 367 6846
ARPA: campbell%maynard.uucp@harvisr.harvard.edu MCI: LCAMPBELL
Technical Details
Message-ID:
<779@maynard.BSW.COM>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ll-xn!mit-eddie!husc6!wjh12!maynard!campbellReferences:
<403@vixie.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ll-xn!mit-eddie!husc6!wjh12!maynard!campbell From: campbell@maynard.BSW.COM (Larry Campbell) Newsgroups: comp.sources.d Subject: Re: Multivol dumps core? Message-ID: <779@maynard.BSW.COM> Date: Mon, 15-Dec-86 22:45:39 EST Article-I.D.: maynard.779 Posted: Mon Dec 15 22:45:39 1986 Date-Received: Wed, 17-Dec-86 04:15:10 EST References: <403@vixie.UUCP> Reply-To: campbell@maynard.UUCP (Larry Campbell) Distribution: world Organization: The Boston Software Works, Inc. Lines: 26