From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XXBA4-0001mc-VM for mharc-grub-devel@gnu.org; Thu, 25 Sep 2014 11:40:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXB9y-0001kp-MD for grub-devel@gnu.org; Thu, 25 Sep 2014 11:40:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXB9s-0007z8-Lq for grub-devel@gnu.org; Thu, 25 Sep 2014 11:40:46 -0400 Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]:39808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXB9s-0007xx-8M for grub-devel@gnu.org; Thu, 25 Sep 2014 11:40:40 -0400 Received: by mail-lb0-f175.google.com with SMTP id w7so7086797lbi.6 for ; Thu, 25 Sep 2014 08:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=NRc0vf/0OWWbNxWX+ItXE7epp8JKn0Tt7MeR7xhT36Y=; b=apgZd6U/H7frhY2JzRNn5CeVIz1Nkx9IWmKL8vfv1yGZvdiVGeF2Lu88gwakHoNPLu EXI+WIZ1jxKmFd80mp2pSNSfbONnDEdh2Zs8Hr9qyBjzudYyu44T7/YSB706lH+F+Kov zmxr7k/PEQB/DBfecwhfCqr1Mpiy1pO8t21R8TEVqSPYX+P9rxBobf00siw1dBhz5PGi zxqr88Fm9Ock+fNcwlb+4D2br9DyDi/P9aUx5h87zYQ0yRqFbATcjEU8gycrmdZSwsHz WM8DWIW8wMvhgFaD5WLJeBeNwvroA873H/ZPhmMsPdxwdjeYJWVqPosTFDsYxx4m8o5L Qkqg== X-Received: by 10.112.78.38 with SMTP id y6mr4211029lbw.94.1411659633618; Thu, 25 Sep 2014 08:40:33 -0700 (PDT) Received: from localhost.localdomain (ppp94-29-94-89.pppoe.spdop.ru. [94.29.94.89]) by mx.google.com with ESMTPSA id l2sm924521lbd.48.2014.09.25.08.40.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Sep 2014 08:40:32 -0700 (PDT) From: Andrey Borzenkov To: grub-devel@gnu.org Subject: [PATCH] update m4/extern-inline.m4 to upstream version to fix compilation on FreeBSD Date: Thu, 25 Sep 2014 19:40:28 +0400 Message-Id: <1411659628-30272-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <53D2CE98.9070702@gmail.com> References: <53D2CE98.9070702@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22f X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 15:40:51 -0000 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 --- 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 - . - _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 . - Suppress the use of extern inline on Apple's platforms, - as Libc-825.25 (2012-09-19) is incompatible with it; see - . - 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 . 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 . + 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 + . */ # 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)