bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] Do not use inline in argp.h on FreeBSD


From: Andrey Borzenkov
Subject: [PATCH] Do not use inline in argp.h on FreeBSD
Date: Fri, 25 Jul 2014 19:28:24 +0400

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 <address@hidden>
Tested-By: Beeblebrox <address@hidden>
Signed-off-by: Andrey Borzenkov <address@hidden>

---
 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)



reply via email to

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