* guile-1.8.6: libguile/inline.h nitpick
@ 2009-01-28 0:22 David Fang
2009-02-05 22:15 ` Neil Jerram
0 siblings, 1 reply; 3+ messages in thread
From: David Fang @ 2009-01-28 0:22 UTC (permalink / raw)
To: guile-devel
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?
Thanks.
Fang
David Fang
http://www.csl.cornell.edu/~fang/
http://www.achronix.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: guile-1.8.6: libguile/inline.h nitpick
2009-01-28 0:22 guile-1.8.6: libguile/inline.h nitpick David Fang
@ 2009-02-05 22:15 ` Neil Jerram
2009-02-05 22:24 ` David Fang
0 siblings, 1 reply; 3+ messages in thread
From: Neil Jerram @ 2009-02-05 22:15 UTC (permalink / raw)
To: David Fang; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
David Fang <fang@csl.cornell.edu> 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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-build-when-compiled-with-Wundef-Werror.patch --]
[-- Type: text/x-diff, Size: 1829 bytes --]
From a24f4637eac7cd6b83f6238ea288139fee554bc4 Mon Sep 17 00:00:00 2001
From: Neil Jerram <neil@ossau.uklinux.net>
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
\f
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: guile-1.8.6: libguile/inline.h nitpick
2009-02-05 22:15 ` Neil Jerram
@ 2009-02-05 22:24 ` David Fang
0 siblings, 0 replies; 3+ messages in thread
From: David Fang @ 2009-02-05 22:24 UTC (permalink / raw)
To: Neil Jerram; +Cc: guile-devel
>> Can we change line 57 from:
>> 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.
Thanks, Neil! Patch looks good to me.
Fang
David Fang
http://www.csl.cornell.edu/~fang/
http://www.achronix.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-05 22:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28 0:22 guile-1.8.6: libguile/inline.h nitpick David Fang
2009-02-05 22:15 ` Neil Jerram
2009-02-05 22:24 ` David Fang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).