All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Do not use inline in argp.h on FreeBSD
@ 2014-07-25 15:28 Andrey Borzenkov
  2014-07-25 21:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2014-08-04 18:40 ` [PATCH] Do not use inline in argp.h " Paul Eggert
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Borzenkov @ 2014-07-25 15:28 UTC (permalink / raw
  To: bug-gnulib; +Cc: grub-devel, zaphod

This fixes this error:

In file included from util/grub-mkimage.c:54:0:
./grub-core/gnulib/argp.h:627:49: error: '__sbistype' is static but
used in inline function '_option_is_short' which is not static
[-Werror] cc1: all warnings being treated as errors gmake[2]: ***
[util/grub_mkimage-grub-mkimage.o] Error 1

Treat FreeBSD similar to Apple and do not try inlines. It currently
does it for GCC only, as this is what had been tested.

Reported-By: Beeblebrox <zaphod@berentweb.com>
Tested-By: Beeblebrox <zaphod@berentweb.com>
Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>

---
 m4/extern-inline.m4 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 240150e..009b928 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -24,7 +24,10 @@ AC_DEFUN([gl_EXTERN_INLINE],
    <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
    OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
    for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
-   Perhaps Apple will fix this some day.  */
+   Perhaps Apple will fix this some day.
+
+   Suppress use of inlines on FreeBSD with GCC similar to Apple. It fails to
+   compile arpg.h due to static inlines in ctype.h  */
 #if (defined __APPLE__ \
      && (defined __header_inline \
          ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
@@ -36,7 +39,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
 # define _GL_EXTERN_INLINE_APPLE_BUG
 #endif
 #if ((__GNUC__ \
-      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__) \
+         && !defined __FreeBSD__ \
       : (199901L <= __STDC_VERSION__ \
          && !defined __HP_cc \
          && !(defined __SUNPRO_C && __STDC__))) \
@@ -45,7 +49,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
 # define _GL_EXTERN_INLINE extern inline
 # define _GL_EXTERN_INLINE_IN_USE
 #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
-       && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+       && !defined _GL_EXTERN_INLINE_APPLE_BUG && !defined __FreeBSD__)
 # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
    /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
 #  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
-- 
tg: (5acee27..) FreeBSD-ctype.h (depends on: master)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Do not use inline in argp.h on FreeBSD
  2014-07-25 15:28 [PATCH] Do not use inline in argp.h on FreeBSD Andrey Borzenkov
@ 2014-07-25 21:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2014-07-26  3:58   ` Andrey Borzenkov
  2014-09-25 15:40   ` [PATCH] update m4/extern-inline.m4 to upstream version to fix compilation " Andrey Borzenkov
  2014-08-04 18:40 ` [PATCH] Do not use inline in argp.h " Paul Eggert
  1 sibling, 2 replies; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-07-25 21:39 UTC (permalink / raw
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2628 bytes --]

On 25.07.2014 17:28, Andrey Borzenkov wrote:
> This fixes this error:
> 
> In file included from util/grub-mkimage.c:54:0:
> ./grub-core/gnulib/argp.h:627:49: error: '__sbistype' is static but
> used in inline function '_option_is_short' which is not static
> [-Werror] cc1: all warnings being treated as errors gmake[2]: ***
> [util/grub_mkimage-grub-mkimage.o] Error 1
> 
Did you contatc gnulib? Can we just silence this warning?
> Treat FreeBSD similar to Apple and do not try inlines. It currently
> does it for GCC only, as this is what had been tested.
> 
> Reported-By: Beeblebrox <zaphod@berentweb.com>
> Tested-By: Beeblebrox <zaphod@berentweb.com>
> Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
> 
> ---
>  m4/extern-inline.m4 | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
> index 240150e..009b928 100644
> --- a/m4/extern-inline.m4
> +++ b/m4/extern-inline.m4
> @@ -24,7 +24,10 @@ AC_DEFUN([gl_EXTERN_INLINE],
>     <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
>     OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
>     for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
> -   Perhaps Apple will fix this some day.  */
> +   Perhaps Apple will fix this some day.
> +
> +   Suppress use of inlines on FreeBSD with GCC similar to Apple. It fails to
> +   compile arpg.h due to static inlines in ctype.h  */
>  #if (defined __APPLE__ \
>       && (defined __header_inline \
>           ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
> @@ -36,7 +39,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
>  # define _GL_EXTERN_INLINE_APPLE_BUG
>  #endif
>  #if ((__GNUC__ \
> -      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
> +      ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__) \
> +         && !defined __FreeBSD__ \
>        : (199901L <= __STDC_VERSION__ \
>           && !defined __HP_cc \
>           && !(defined __SUNPRO_C && __STDC__))) \
> @@ -45,7 +49,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
>  # define _GL_EXTERN_INLINE extern inline
>  # define _GL_EXTERN_INLINE_IN_USE
>  #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
> -       && !defined _GL_EXTERN_INLINE_APPLE_BUG)
> +       && !defined _GL_EXTERN_INLINE_APPLE_BUG && !defined __FreeBSD__)
>  # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
>     /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
>  #  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Do not use inline in argp.h on FreeBSD
  2014-07-25 21:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2014-07-26  3:58   ` Andrey Borzenkov
  2014-09-25 15:40   ` [PATCH] update m4/extern-inline.m4 to upstream version to fix compilation " Andrey Borzenkov
  1 sibling, 0 replies; 5+ messages in thread
From: Andrey Borzenkov @ 2014-07-26  3:58 UTC (permalink / raw
  To: The development of GNU GRUB; +Cc: phcoder

[-- Attachment #1: Type: text/plain, Size: 3204 bytes --]

В Fri, 25 Jul 2014 23:39:36 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:

> On 25.07.2014 17:28, Andrey Borzenkov wrote:
> > This fixes this error:
> > 
> > In file included from util/grub-mkimage.c:54:0:
> > ./grub-core/gnulib/argp.h:627:49: error: '__sbistype' is static but
> > used in inline function '_option_is_short' which is not static
> > [-Werror] cc1: all warnings being treated as errors gmake[2]: ***
> > [util/grub_mkimage-grub-mkimage.o] Error 1
> > 
> Did you contatc gnulib? 

Yes, this was sent to gnulib list :)

>                         Can we just silence this warning?

Apparently not for this particular case, and this warning is real, it
should not be simply ignored. Unfortunately, while FreeBSD allows to
disable "static inline" in _ctype.h it breaks compilation due to
different FreeBSD bug, so this looks like the only workaround. 

> > Treat FreeBSD similar to Apple and do not try inlines. It currently
> > does it for GCC only, as this is what had been tested.
> > 
> > Reported-By: Beeblebrox <zaphod@berentweb.com>
> > Tested-By: Beeblebrox <zaphod@berentweb.com>
> > Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
> > 
> > ---
> >  m4/extern-inline.m4 | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
> > index 240150e..009b928 100644
> > --- a/m4/extern-inline.m4
> > +++ b/m4/extern-inline.m4
> > @@ -24,7 +24,10 @@ AC_DEFUN([gl_EXTERN_INLINE],
> >     <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
> >     OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
> >     for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
> > -   Perhaps Apple will fix this some day.  */
> > +   Perhaps Apple will fix this some day.
> > +
> > +   Suppress use of inlines on FreeBSD with GCC similar to Apple. It fails to
> > +   compile arpg.h due to static inlines in ctype.h  */
> >  #if (defined __APPLE__ \
> >       && (defined __header_inline \
> >           ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
> > @@ -36,7 +39,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
> >  # define _GL_EXTERN_INLINE_APPLE_BUG
> >  #endif
> >  #if ((__GNUC__ \
> > -      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
> > +      ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__) \
> > +         && !defined __FreeBSD__ \
> >        : (199901L <= __STDC_VERSION__ \
> >           && !defined __HP_cc \
> >           && !(defined __SUNPRO_C && __STDC__))) \
> > @@ -45,7 +49,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
> >  # define _GL_EXTERN_INLINE extern inline
> >  # define _GL_EXTERN_INLINE_IN_USE
> >  #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
> > -       && !defined _GL_EXTERN_INLINE_APPLE_BUG)
> > +       && !defined _GL_EXTERN_INLINE_APPLE_BUG && !defined __FreeBSD__)
> >  # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
> >     /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
> >  #  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
> > 
> 
> 


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Do not use inline in argp.h on FreeBSD
  2014-07-25 15:28 [PATCH] Do not use inline in argp.h on FreeBSD Andrey Borzenkov
  2014-07-25 21:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2014-08-04 18:40 ` Paul Eggert
  1 sibling, 0 replies; 5+ messages in thread
From: Paul Eggert @ 2014-08-04 18:40 UTC (permalink / raw
  To: Andrey Borzenkov, bug-gnulib; +Cc: grub-devel, zaphod

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

Thanks for the heads-up.  I installed the attached patch into the gnulib 
master.  It differs from your patch but should do the job.  Please give 
it a try.

[-- Attachment #2: 0001-extern-inline-port-to-FreeBSD-DragonFly.patch --]
[-- Type: text/plain, Size: 4674 bytes --]

From 6a3948b87d6df36207df685e726ed1e972a01d28 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 4 Aug 2014 11:30:33 -0700
Subject: [PATCH] extern-inline: port to FreeBSD, DragonFly

* m4/extern-inline.m4 (gl_EXTERN_INLINE): Also assume the bug
is present if either __DragonFly__ or __FreeBSD__ is defined.
FreeBSD problem reported by Andrey Borzenkov in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
Also, worry about __APPLE__ only if __MACH__ is also defined,
as this is more consistent with the rest of gnulib.
(_GL_EXTERN_INLINE_STDHEADER_BUG): Rename this internal macro from
_GL_EXTERN_INLINE_APPLE_BUG, since the bug is not limited to Apple.
---
 ChangeLog           | 12 ++++++++++++
 m4/extern-inline.m4 | 31 +++++++++++++++++++++++--------
 2 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 59ce3dc..bdf743a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-08-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+	extern-inline: port to FreeBSD, DragonFly
+	* m4/extern-inline.m4 (gl_EXTERN_INLINE): Also assume the bug
+	is present if either __DragonFly__ or __FreeBSD__ is defined.
+	FreeBSD problem reported by Andrey Borzenkov in:
+	http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+	Also, worry about __APPLE__ only if __MACH__ is also defined,
+	as this is more consistent with the rest of gnulib.
+	(_GL_EXTERN_INLINE_STDHEADER_BUG): Rename this internal macro from
+	_GL_EXTERN_INLINE_APPLE_BUG, since the bug is not limited to Apple.
+
 2014-08-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	regex: Make #if/#ifdef usage consistent for DEBUG
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 240150e..7f1bb39 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -19,13 +19,28 @@ AC_DEFUN([gl_EXTERN_INLINE],
    'reference to static identifier "f" in extern inline function'.
    This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
 
-   Suppress the use of extern inline on problematic Apple configurations.
-   OS X 10.8 and earlier mishandle it; see, e.g.,
-   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+   on configurations that mistakenly use 'static inline' to implement
+   functions or macros in standard C headers like <ctype.h>.  For example,
+   if isdigit is mistakenly implemented via a static inline function,
+   a program containing an extern inline function that calls isdigit
+   may not work since the C standard prohibits extern inline functions
+   from calling static functions.  This bug is known to occur on:
+
+     OS X 10.8 and earlier; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+     DragonFly; see
+     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+     FreeBSD; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+
    OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
    for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
-   Perhaps Apple will fix this some day.  */
-#if (defined __APPLE__ \
+   Assume DragonFly and FreeBSD will be similar.  */
+#if (((defined __APPLE__ && defined __MACH__) \
+      || defined __DragonFly__ || defined __FreeBSD__) \
      && (defined __header_inline \
          ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
             && ! defined __clang__) \
@@ -33,19 +48,19 @@ AC_DEFUN([gl_EXTERN_INLINE],
              && (defined __GNUC__ || defined __cplusplus)) \
             || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
                 && defined __GNUC__ && ! defined __cplusplus))))
-# define _GL_EXTERN_INLINE_APPLE_BUG
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
 #endif
 #if ((__GNUC__ \
       ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
       : (199901L <= __STDC_VERSION__ \
          && !defined __HP_cc \
          && !(defined __SUNPRO_C && __STDC__))) \
-     && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+     && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
 # define _GL_INLINE inline
 # define _GL_EXTERN_INLINE extern inline
 # define _GL_EXTERN_INLINE_IN_USE
 #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
-       && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+       && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
 # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
    /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
 #  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] update m4/extern-inline.m4 to upstream version to fix compilation on FreeBSD
  2014-07-25 21:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2014-07-26  3:58   ` Andrey Borzenkov
@ 2014-09-25 15:40   ` Andrey Borzenkov
  1 sibling, 0 replies; 5+ messages in thread
From: Andrey Borzenkov @ 2014-09-25 15:40 UTC (permalink / raw
  To: grub-devel

In file included from util/grub-mkimage.c:54:0:
./grub-core/gnulib/argp.h:627:49: error: '__sbistype' is static but
used in inline function '_option_is_short' which is not static
[-Werror] cc1: all warnings being treated as errors gmake[2]: ***
[util/grub_mkimage-grub-mkimage.o] Error 1

Update m4/extern-inline.m4 to current upstream gnulib version that
contains fix for this (commit 2c93b8bb4912c884bf6e416536441309e7aa7bf2).

Reported-By: Beeblebrox <zaphod@berentweb.com>

---
 m4/extern-inline.m4 | 70 +++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 52 insertions(+), 18 deletions(-)

diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 0152f29..7f1bb39 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -1,6 +1,6 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012-2013 Free Software Foundation, Inc.
+dnl Copyright 2012-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,37 +8,67 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_EXTERN_INLINE],
 [
   AH_VERBATIM([extern_inline],
-[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
-   _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
-   _GL_INLINE_HEADER_BEGIN contains useful stuff to put
-     in an include file, before uses of _GL_INLINE.
-     It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
-     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.
+[/* Please see the Gnulib manual for how to use these macros.
 
    Suppress extern inline with HP-UX cc, as it appears to be broken; see
    <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
 
-   Suppress the use of 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.  */
+   Suppress extern inline with Sun C in standards-conformance mode, as it
+   mishandles inline functions that call each other.  E.g., for 'inline void f
+   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+   'reference to static identifier "f" in extern inline function'.
+   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+   Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+   on configurations that mistakenly use 'static inline' to implement
+   functions or macros in standard C headers like <ctype.h>.  For example,
+   if isdigit is mistakenly implemented via a static inline function,
+   a program containing an extern inline function that calls isdigit
+   may not work since the C standard prohibits extern inline functions
+   from calling static functions.  This bug is known to occur on:
+
+     OS X 10.8 and earlier; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+     DragonFly; see
+     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+     FreeBSD; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+
+   OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+   for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
+   Assume DragonFly and FreeBSD will be similar.  */
+#if (((defined __APPLE__ && defined __MACH__) \
+      || defined __DragonFly__ || defined __FreeBSD__) \
+     && (defined __header_inline \
+         ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+            && ! defined __clang__) \
+         : ((! defined _DONT_USE_CTYPE_INLINE_ \
+             && (defined __GNUC__ || defined __cplusplus)) \
+            || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+                && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
 #if ((__GNUC__ \
       ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
-      : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \
-     && !defined __APPLE__)
+      : (199901L <= __STDC_VERSION__ \
+         && !defined __HP_cc \
+         && !(defined __SUNPRO_C && __STDC__))) \
+     && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
 # define _GL_INLINE inline
 # define _GL_EXTERN_INLINE extern inline
-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
-# if __GNUC_GNU_INLINE__
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+       && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
    /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
 #  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
 # else
 #  define _GL_INLINE extern inline
 # endif
 # define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
 #else
 # define _GL_INLINE static _GL_UNUSED
 # define _GL_EXTERN_INLINE static _GL_UNUSED
@@ -51,6 +81,10 @@ AC_DEFUN([gl_EXTERN_INLINE],
 #  define _GL_INLINE_HEADER_CONST_PRAGMA \
      _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
 # endif
+  /* Suppress GCC's bogus "no previous prototype for 'FOO'"
+     and "no previous declaration for 'FOO'"  diagnostics,
+     when FOO is an inline function in the header; see
+     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.  */
 # define _GL_INLINE_HEADER_BEGIN \
     _Pragma ("GCC diagnostic push") \
     _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
-- 
tg: (5d90f6e..) u/freebsd-ctype.h-static-inline (depends on: master)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-25 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 15:28 [PATCH] Do not use inline in argp.h on FreeBSD Andrey Borzenkov
2014-07-25 21:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-07-26  3:58   ` Andrey Borzenkov
2014-09-25 15:40   ` [PATCH] update m4/extern-inline.m4 to upstream version to fix compilation " Andrey Borzenkov
2014-08-04 18:40 ` [PATCH] Do not use inline in argp.h " Paul Eggert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.