[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_C_RESTRICT and C/C++
From: |
Paul Eggert |
Subject: |
Re: AC_C_RESTRICT and C/C++ |
Date: |
Sun, 21 Oct 2007 23:32:47 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> /* Define to equivalent of C99 restrict keyword, or to nothing if this
> is not supported. Do not define if restrict is supported directly. */
> #ifdef __cplusplus
> #define restrict
> #else
> #define restrict _Restrict
> #endif
That sounds a bit pessimistic, since the semantics of "restrict" is
available in some C++ compilers. We shouldn't penalize these
compilers merely because Sun's C++ compiler disagrees with its C
compiler.
Would it suffice to append this to config.h? I don't have easy access
to Sun C 5.0 any more (it's pretty old).
/* Work around a bug in Sun C++: it does not support _Restrict, even
though the corresponding Sun C compiler does. Perhaps some future
version of Sun C++ will work with _Restrict; if so, it'll probably
define __RESTRICT, just as Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
#endif