Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765526AbXEYVEN (ORCPT ); Fri, 25 May 2007 17:04:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752683AbXEYVD7 (ORCPT ); Fri, 25 May 2007 17:03:59 -0400 Received: from an-out-0708.google.com ([209.85.132.251]:52526 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756131AbXEYVD4 (ORCPT ); Fri, 25 May 2007 17:03:56 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Tjs0jhfkc1J7MWpuUqXr3yowFpFrIGyjg9uz7611JvxI03S751+M9C6y/HM67QXOG9vRwrWxheWSSzLzE2LsiKYl5H2iBr+5z7vvRG2+FvghoybgjLE91o/5QA3nvU3FxIa7JI8eUakD46rI5Xqgg4iXzAVQ6FOvOWLeDEmuEUI= Message-ID: Date: Sat, 26 May 2007 02:33:51 +0530 From: "Satyam Sharma" To: "Al Viro" Subject: Re: double exclamation (!!) suckage in the kernel Cc: "Linux Kernel Mailing List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070525204127.GK4095@ftp.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 969 Lines: 26 On 5/26/07, Satyam Sharma wrote: > On 5/26/07, Al Viro wrote: > > > > That's a question for a quiz in introductory course on C: > > Ugh ... ok, I've embarrassed myself publicly already, so I'll > also be brave enough to take a C quiz here :-) Hmmm, and now I seem to have flunked ... > > what type should x have for !!x to be a valid expression? > > Any integer type (includes pointers) gcc doesn't seem to mind a ! on a float either (does it do an implicit cast to int first?). Can't think of too many situations where one would want to do a ! on a float, actually, in any case ... > > what will be the type of result? > > int (I guess boolean for C99?) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/