8c6b1ac71e
Also include some minor fixes for gcc 5.1.1 Signed-off-by: Peter Jones <pjones@redhat.com>
131 lines
5.9 KiB
Diff
131 lines
5.9 KiB
Diff
From 20f21d897858d827210d67c75f42d18887cbce81 Mon Sep 17 00:00:00 2001
|
|
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
|
Date: Thu, 5 Mar 2015 19:25:56 +0300
|
|
Subject: [PATCH 357/506] update m4/extern-inline.m4 to upstream version to fix
|
|
compilation on FreeBSD
|
|
|
|
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 b9bfe78424b871f5b92e5ee9e7d21ef951a6801d).
|
|
|
|
Reported-By: Beeblebrox <zaphod@berentweb.com>
|
|
---
|
|
m4/extern-inline.m4 | 71 +++++++++++++++++++++++++++++++++++++++--------------
|
|
1 file changed, 53 insertions(+), 18 deletions(-)
|
|
|
|
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
|
|
index 0152f29..e74339a 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-2015 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,42 +8,77 @@ 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
|
|
#endif
|
|
|
|
+/* In GCC, suppress bogus "no previous prototype for 'FOO'"
|
|
+ and "no previous declaration for 'FOO'" diagnostics,
|
|
+ when FOO is an inline function in the header; see
|
|
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
|
|
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
|
|
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
|
|
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
|
|
# define _GL_INLINE_HEADER_CONST_PRAGMA
|
|
--
|
|
2.4.3
|
|
|