From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: guile-1.8.6: libguile/inline.h nitpick Date: Thu, 05 Feb 2009 22:15:49 +0000 Message-ID: <87wsc4h6ne.fsf@arudy.ossau.uklinux.net> References: <20090127190338.W71592@shannon.csl.cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1233872361 2668 80.91.229.12 (5 Feb 2009 22:19:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 22:19:21 +0000 (UTC) Cc: guile-devel@gnu.org To: David Fang Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Feb 05 23:20:32 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LVCaC-0007c5-Fa for guile-devel@m.gmane.org; Thu, 05 Feb 2009 23:20:30 +0100 Original-Received: from localhost ([127.0.0.1]:59794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVCYq-0001BN-Nl for guile-devel@m.gmane.org; Thu, 05 Feb 2009 17:19:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVCVw-0000RN-5X for guile-devel@gnu.org; Thu, 05 Feb 2009 17:16:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVCVs-0000RB-TU for guile-devel@gnu.org; Thu, 05 Feb 2009 17:16:03 -0500 Original-Received: from [199.232.76.173] (port=48343 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVCVs-0000R8-Ox for guile-devel@gnu.org; Thu, 05 Feb 2009 17:16:00 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]:60470) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LVCVr-0003aA-BJ for guile-devel@gnu.org; Thu, 05 Feb 2009 17:16:00 -0500 Original-Received: from arudy (host86-157-180-39.range86-157.btcentralplus.com [86.157.180.39]) by mail3.uklinux.net (Postfix) with ESMTP id CE5221F6634; Thu, 5 Feb 2009 22:15:51 +0000 (GMT) Original-Received: from arudy.ossau.uklinux.net (arudy [127.0.0.1]) by arudy (Postfix) with ESMTP id 0AFF338012; Thu, 5 Feb 2009 22:15:49 +0000 (GMT) In-Reply-To: <20090127190338.W71592@shannon.csl.cornell.edu> (David Fang's message of "Tue\, 27 Jan 2009 19\:22\:13 -0500 \(EST\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8136 Archived-At: --=-=-= David Fang writes: > Hi all, > > Minor nit about the "libguile/inline.h" header: > > I typically compile with g++ ... -Wundef -Werror, which catches uses > of undefined preprocessor tokens: > > /usr/local/include/libguile/inline.h:57:31: "__APPLE_CC__" is not defined > In file included from /usr/local/include/libguile.h:114, > /usr/local/include/libguile/inline.h:57:31: "__APPLE_CC__" is not defined > > __APPLE_CC__ is only defined for Apple, which is causing my compiles > to fail (didn't used to fail with older guile.) > > > Can we change line 57 from: > > # if (defined __GNUC__) && (!(__APPLE_CC__ > 5400 && __STDC_VERSION__ >>= 199901L > > to something like: > > # if (defined __GNUC__) && (!((defined __APPLE_CC__) && __APPLE_CC__ > > 5400 && __STDC_VERSION__ >= 199901L > > which checks for __APPLE_CC__ defined before using it? Sure. Proposed patch for this is attached, please let me know if any comments. Regards, Neil --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-build-when-compiled-with-Wundef-Werror.patch >From a24f4637eac7cd6b83f6238ea288139fee554bc4 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Thu, 5 Feb 2009 22:03:53 +0000 Subject: [PATCH] Fix build when compiled with -Wundef -Werror (Reported by David Fang) * libguile/inline.h: Check if __APPLE_CC__ is defined before testing its value. --- NEWS | 1 + THANKS | 1 + libguile/inline.h | 2 +- 3 files changed, 3 insertions(+), 1 deletions(-) diff --git a/NEWS b/NEWS index 1fe8b91..71e9dc0 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ Changes in 1.8.7 (since 1.8.6) ** Fix %fast-slot-ref/set!, to avoid possible segmentation fault ** Fix MinGW build problem caused by HAVE_STRUCT_TIMESPEC confusion ** Fix build problem when scm_t_timespec is different from struct timespec +** Fix build when compiled with -Wundef -Werror Changes in 1.8.6 (since 1.8.5) diff --git a/THANKS b/THANKS index c5d7d0a..feafc12 100644 --- a/THANKS +++ b/THANKS @@ -36,6 +36,7 @@ For fixes or providing information which led to a fix: Nils Durner John W Eaton Clinton Ebadi + David Fang Charles Gagnon Peter Gavin Eric Gillespie, Jr diff --git a/libguile/inline.h b/libguile/inline.h index 8fa9a8c..eae1e22 100644 --- a/libguile/inline.h +++ b/libguile/inline.h @@ -54,7 +54,7 @@ C99 mode and doesn't define `__GNUC_STDC_INLINE__'. Fall back to "static inline" in that case. */ -# if (defined __GNUC__) && (!(__APPLE_CC__ > 5400 && __STDC_VERSION__ >= 199901L)) +# if (defined __GNUC__) && (!(((defined __APPLE_CC__) && (__APPLE_CC__ > 5400)) && __STDC_VERSION__ >= 199901L)) # define SCM_C_USE_EXTERN_INLINE 1 # if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) # define SCM_C_EXTERN_INLINE \ -- 1.5.6.5 --=-=-=--