Date: Fri, 30 Jun 2006 04:14:20 +0200 From: Matthias Andree <matthias.andree@gmx.de> To: Harti Brandt <harti@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: Return value of malloc(0) Message-ID: <20060630021420.GA11530@merlin.emma.line.org> In-Reply-To: <20060629194138.S55888@beagle.kn.op.dlr.de> References: <20060628181045.GA54915@curry.mchp.siemens.de> <20060629054222.GA92895@leiferikson.flosken.lan> <m3bqsceyf2.fsf@merlin.emma.line.org> <20060629162319.GA94921@leiferikson.flosken.lan> <m33bdnhnv7.fsf@merlin.emma.line.org> <20060629194138.S55888@beagle.kn.op.dlr.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060630021420.GA11530>