grub-devel.gnu.org archive mirror
 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

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 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 NNTP newsgroup(s).