From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC02h-0002Cg-Mw for qemu-devel@nongnu.org; Wed, 12 Sep 2012 23:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TC02f-0000mQ-Vp for qemu-devel@nongnu.org; Wed, 12 Sep 2012 23:24:39 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:55896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC02f-0000lu-DA for qemu-devel@nongnu.org; Wed, 12 Sep 2012 23:24:37 -0400 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Sep 2012 13:22:59 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8D3F5lP28704906 for ; Thu, 13 Sep 2012 13:15:05 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q8D3ODsK017996 for ; Thu, 13 Sep 2012 13:24:13 +1000 Message-ID: <505151D8.9030300@linux.vnet.ibm.com> Date: Thu, 13 Sep 2012 11:24:08 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1347265586-17698-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1347265586-17698-3-git-send-email-xiawenc@linux.vnet.ibm.com> <504FC0B1.7080903@redhat.com> <504FFC05.5070601@linux.vnet.ibm.com> <5050874B.4050505@redhat.com> In-Reply-To: <5050874B.4050505@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V2 2/6] libqblock type and structure defines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, Blue Swirl , pbonzini@redhat.com 于 2012-9-12 20:59, Eric Blake 写道: > On 09/11/2012 09:05 PM, Wenchao Xia wrote: >>> Seriously? We require a C99-compliant compiler, which is required to >>> treat the more compact version identically (all undefined names evaluate >>> to 0 in the preprocessor), and HACKING doesn't mandate that we spell out >>> a defined-ness check first. Okay, so configure adds -Wundef to the set >>> of CFLAGS, but I fail to see why we want -Wundef (that's an >>> anachronistic warning, only there to help you if you are writing code >>> portable to K&R). >>> >> So if the preprocessor replaced __GNUC__ to 0, is there difference >> between these two kinds of macoros? >> #if __GNUC__ >= 4 >> #if defined(__GNUC__) && __GNUC__ >=4 > > The only difference is whether -Wundef will warn, and I'm trying to > argue that qemu's current use of -Wundef is pointless, as that warning > exists solely for K&R compatibility, not for modern standard-compliant > code correctness. > OK ,then I think #if __GNUC__ >= 4 .... #else [warn name space pollution may happen] #endif would be better. -- Best Regards Wenchao Xia