[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix handling of restrict keyword for newer Sun Studio C++.
From: |
Bruno Haible |
Subject: |
Re: [PATCH] Fix handling of restrict keyword for newer Sun Studio C++. |
Date: |
Sat, 10 Apr 2010 17:49:55 +0200 |
User-agent: |
KMail/1.9.9 |
Joel E. Denny wrote:
> Ok to apply this patch?
The change that you are importing from autoconf
2009-01-28 Eric Blake <address@hidden>
Fix AC_C_RESTRICT for Sun Studio 12 C++.
* lib/autoconf/c.m4 (AC_C_RESTRICT): Newer Sun Studio C provides
__restrict__ rather than _Restrict, which still trips up Sun
Studio 12 C++.
* THANKS: Update.
Reported by Rolf Vandevaart.
<http://lists.gnu.org/archive/html/bug-autoconf/2009-01/msg00060.html>
looks correct.
But this change is not essential for gnulib's functioning. It's not
the purpose of gnulib to provide to everyone the newest macros from
GNU Autoconf, unless these fixes are necessary for gnulib.
So, instead of your patch, I would propose to add a conditional,
so that gnulib does not replace AC_C_RESTRICT if the autoconf version
is >= 2.62. Then it's the responsibility of the user to use
Autoconf >= 2.64 if he does not want his users to run into the problem
with Sun Studio 12 C++.
Here's the proposed patch (similar to what we find in m4/mbrtowc.m4):
2010-04-10 Bruno Haible <address@hidden>
* m4/gnulib-common.m4 (AC_C_RESTRICT): Don't define for
autoconf >= 2.62.
Reported by Joel E. Denny <address@hidden>.
--- m4/gnulib-common.m4.orig Sat Apr 10 17:48:13 2010
+++ m4/gnulib-common.m4 Sat Apr 10 17:47:05 2010
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 18
+# gnulib-common.m4 serial 19
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -132,6 +132,7 @@
# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
# works.
# This definition can be removed once autoconf >= 2.62 can be assumed.
+m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
AC_DEFUN([AC_C_RESTRICT],
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
[ac_cv_c_restrict=no
@@ -169,6 +170,7 @@
*) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
esac
])
+])
# gl_BIGENDIAN
# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.