From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 10:38:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50C71065670 for ; Tue, 5 Jul 2011 10:38:35 +0000 (UTC) (envelope-from matthias.andree@gmx.de) Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by mx1.freebsd.org (Postfix) with SMTP id 09A9C8FC16 for ; Tue, 5 Jul 2011 10:38:34 +0000 (UTC) Received: (qmail invoked by alias); 05 Jul 2011 10:38:33 -0000 Received: from f055251049.adsl.alicedsl.de (EHLO apollo.emma.line.org) [78.55.251.49] by mail.gmx.net (mp017) with SMTP; 05 Jul 2011 12:38:33 +0200 X-Authenticated: #428038 X-Provags-ID: V01U2FsdGVkX1+AfVQvXHiAVbnIrqxlA3GUrJjVbEEf2u5gMgLzCy OeuJZQY0ccYPPc Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by apollo.emma.line.org (Postfix) with ESMTP id D87AC23D164 for ; Tue, 5 Jul 2011 12:38:32 +0200 (CEST) Message-ID: <4E12E9A8.1090900@gmx.de> Date: Tue, 05 Jul 2011 12:38:32 +0200 From: Matthias Andree User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Mnenhy/0.8.3 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4E12E358.80002@FreeBSD.org> In-Reply-To: <4E12E358.80002@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Subject: Re: [PATCH] __FreeBSD_cc_version in 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: Tue, 05 Jul 2011 10:38:35 -0000 Am 05.07.2011 12:11, schrieb Dimitry Andric: > On 2011-07-04 18:30, Robert Millan wrote: >> This patch fixes a (harmless) warning when is parsed by >> upstream version of GCC. >> >> -#if __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && >> !defined(__INTEL_COMPILER) >> +#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 >> && defined(__GNUC__) && !defined(__INTEL_COMPILER) > > As far as I can see, this code only gives warnings when compiled with > gcc 4.5 or higher, and when using the -Wundef flag. Isn't it easier to > just remove the -Wundef flag here? > > Additionally, it looks like the C standard is a bit vague about whether > the preprocessor uses short-circuited boolean evaluation (although gcc's > manual says it does), so I'm not sure whether this patch solves the > problem properly either. The CPP #if argument is a /constant-expression/, according to K&R's The C Programming language 2nd ed., so it shall short-circuit.