From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="iso-8859-1" From: Daniel Phillips Subject: Re: page_launder() bug Date: Mon, 7 May 2001 15:49:15 +0200 References: In-Reply-To: MIME-Version: 1.0 Message-Id: <01050715491500.08789@starship> Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org Return-Path: To: Tobias Ringstrom , "David S. Miller" Cc: Jonathan Morton , BERECZ Szabolcs , linux-kernel@vger.kernel.org, linux-mm@kvack.org List-ID: On Monday 07 May 2001 08:26, Tobias Ringstrom wrote: > On Sun, 6 May 2001, David S. Miller wrote: > > It is the most straightforward way to make a '1' or '0' > > integer from the NULL state of a pointer. > > But is it really specified in the C "standards" to be exctly zero or > one, and not zero and non-zero? Yes, and if we did not have this stupid situation where the C language standard is not freely available online then you would not have had to ask. > IMHO, the ?: construct is way more readable and reliable. There is no difference in reliability. Readability is a matter of opinion - my opinion is that they are equally readable. To its credit, gcc produces the same ia32 code in either case: int foo = 999; return 1 + !!foo; : movl $0x3e7,0xfffffffc(%ebp) : cmpl $0x0,0xfffffffc(%ebp) : je 0x80483e0 : mov $0x2,%eax : jmp 0x80483e5 : lea 0x0(%esi),%esi : mov $0x1,%eax : mov %eax,%eax int foo = 999; return foo? 2: 1; : movl $0x3e7,0xfffffffc(%ebp) : cmpl $0x0,0xfffffffc(%ebp) : je 0x80483e0 : mov $0x2,%eax : jmp 0x80483e5 : lea 0x0(%esi),%esi : mov $0x1,%eax : mov %eax,%eax -- Daniel -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/