From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 30 02:14:25 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3E5616A407 for ; Fri, 30 Jun 2006 02:14:25 +0000 (UTC) (envelope-from matthias.andree@gmx.de) Received: from mail.gmx.net (mail.gmx.de [213.165.64.21]) by mx1.FreeBSD.org (Postfix) with SMTP id BCF7C43D48 for ; Fri, 30 Jun 2006 02:14:24 +0000 (GMT) (envelope-from matthias.andree@gmx.de) Received: (qmail invoked by alias); 30 Jun 2006 02:14:23 -0000 Received: from p50911D7D.dip0.t-ipconnect.de (EHLO m2a2.dyndns.org) [80.145.29.125] by mail.gmx.net (mp039) with SMTP; 30 Jun 2006 04:14:23 +0200 X-Authenticated: #428038 Received: from localhost (localhost [127.0.0.1]) by merlin.emma.line.org (Postfix) with ESMTP id B08F12004B2; Fri, 30 Jun 2006 04:14:21 +0200 (CEST) Received: from m2a2.dyndns.org ([127.0.0.1]) by localhost (m2a2.dyndns.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10716-12; Fri, 30 Jun 2006 04:14:20 +0200 (CEST) Received: by merlin.emma.line.org (Postfix, from userid 500) id 2E193200F1B; Fri, 30 Jun 2006 04:14:20 +0200 (CEST) Date: Fri, 30 Jun 2006 04:14:20 +0200 From: Matthias Andree To: Harti Brandt Message-ID: <20060630021420.GA11530@merlin.emma.line.org> References: <20060628181045.GA54915@curry.mchp.siemens.de> <20060629054222.GA92895@leiferikson.flosken.lan> <20060629162319.GA94921@leiferikson.flosken.lan> <20060629194138.S55888@beagle.kn.op.dlr.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060629194138.S55888@beagle.kn.op.dlr.de> X-PGP-Key: http://home.pages.de/~mandree/keys/GPGKEY.asc User-Agent: Mutt/1.5.11-2006-06-08 X-Virus-Scanned: amavisd-new at emma.line.org X-Y-GMX-Trusted: 0 Cc: freebsd-hackers@freebsd.org Subject: Re: Return value of malloc(0) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2006 02:14:25 -0000 On Thu, 29 Jun 2006, Harti Brandt wrote: > Operator precedence is just for parsing, not for evaluation. The > compiler may well first evaluate the foo on the right side of the == (by > fetching it) and then go an call malloc and assign foo. Right, thanks for reminding me. I don't usually write code that depends on evaluation order... except with the short-circuiting stuff || or &&. splint 3.1.1 complains about this issue BTW, but neither GCC 4.1.0 nor ICC 8.1.028 on Linux nor FreeBSD lint complain. I used gcc -Wall which is specified to include -Wsequence-point... > It is actually undefined behaviour, I think, so it may well make explode > your near-by atom power plant. It had better not... -- Matthias Andree