bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xalloc: missing prototype


From: Paul Eggert
Subject: Re: xalloc: missing prototype
Date: Fri, 07 Dec 2012 09:37:15 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/07/2012 12:45 AM, Akim Demaille wrote:

> I don't understand
> why GCC does not accept that inline functions call static
> functions that are inline too.

The C Standard requires a diagnostic here, as the rule that you
quoted is a constraint.  So this is really more a question for
the developers of the C Standard, not for the GCC maintainers.

Anyhow, clearly this is a bug in Darwin.  Standard C headers cannot
use 'static inline' to define functions that might be called by
user code, as the user code might be in an extern inline function,
which can't call static inline functions.

If you're a Darwin user can you please report this bug?
Also, does the following patch work around the problem for you?
If so, I'll push it into gnulib.

Also, Gnulib itself suffers from this problem in some of its .h
files -- I'll try to take a look at that when I find the time.

>From 9fb0699950f4ae2541612a6f5d9c47197b6b25c3 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Fri, 7 Dec 2012 09:31:21 -0800
Subject: [PATCH] extern-inline: avoid incompatibility with Darwin Libc

* m4/extern-inline.m4 (_GL_INLINE, _GL_EXTERN_INLINE) [__APPLE__]:
Do not use C99 extern inline.
---
 ChangeLog           |  6 ++++++
 m4/extern-inline.m4 | 14 ++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fb6f84e..5f67f15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-07  Paul Eggert  <address@hidden>
+
+       extern-inline: avoid incompatibility with Darwin Libc
+       * m4/extern-inline.m4 (_GL_INLINE, _GL_EXTERN_INLINE) [__APPLE__]:
+       Do not use C99 extern inline.
+
 2012-12-05  Paul Eggert  <address@hidden>
 
        list, oset, xlist, xoset: fix extern inline issue with C99
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 2492260..6cefba3 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -16,10 +16,16 @@ AC_DEFUN([gl_EXTERN_INLINE],
      when FOO is an inline function in the header; see
      <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
    _GL_INLINE_HEADER_END contains useful stuff to put
-     in the same include file, after uses of _GL_INLINE.  */
-#if (__GNUC__ \
-     ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
-     : 199901L <= __STDC_VERSION__)
+     in the same include file, after uses of _GL_INLINE.
+
+   Suppress the use of C99 extern inline on Apple's platforms,
+   as Libc-825.25 (2012-09-19) is incompatible with it; see
+   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   Perhaps Apple will fix this some day.  */
+#if ((__GNUC__ \
+      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      : 199901L <= __STDC_VERSION__) \
+     && !defined __APPLE__)
 # define _GL_INLINE inline
 # define _GL_EXTERN_INLINE extern inline
 #elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
-- 
1.7.11.7





reply via email to

[Prev in Thread] Current Thread [Next in Thread]