From owner-freebsd-stable Mon Sep 25 15:17:13 2000 Delivered-To: freebsd-stable@freebsd.org Received: from freeway.dcfinc.com (cx74889-a.phnx3.az.home.com [24.1.193.157]) by hub.freebsd.org (Postfix) with ESMTP id A280037B43C for ; Mon, 25 Sep 2000 15:17:11 -0700 (PDT) Received: (from chad@localhost) by freeway.dcfinc.com (8.8.8/8.8.8) id PAA22260; Mon, 25 Sep 2000 15:17:07 -0700 (MST) (envelope-from chad) From: "Chad R. Larson" Message-Id: <200009252217.PAA22260@freeway.dcfinc.com> Subject: Re: Constant panics on 4.1-STABLE! In-Reply-To: from BSD at "Sep 23, 0 11:20:02 pm" To: bsd@shell-server.com (BSD) Date: Mon, 25 Sep 2000 15:17:06 -0700 (MST) Cc: msa@dinosauricon.com, stable@FreeBSD.ORG Reply-To: chad@DCFinc.com Organization: DCF, Inc. X-O/S: FreeBSD 2.2.8-STABLE X-Unexpected: The Spanish Inquisition X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As I recall, BSD wrote: > C doesn't guarantee order of execution in if ( bleh && bleh && bleh). > It may very well evaluate it backwards, or from the inside out if it > wants. No? Not quite. C is free to rearrange the order in which an expression is evaluated. But the logical operators "&&", "||", ":?" and the comma operator define "sequence points" at which all previous side effects of execution are to have taken place and at which no subsequent side effects will have occurred. So, if your "bleh" above is an expression, "(a+b)+(c+d)", it could be evaluated as "(a+d)+(b+c)", but the seperate logical values would be tested in order. Reference: Harbison & Steele, Fourth Edition, sections 7.2 and 7.12. -crl -- Chad R. Larson (CRL15) 602-953-1392 Brother, can you paradigm? chad@dcfinc.com chad@larsons.org larson1@home.net DCF, Inc. - 14623 North 49th Place, Scottsdale, Arizona 85254-2207 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message