[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug with AC_C_RESTRICT on non-GNU-C compiler when using GLIBC
From: |
Paul Eggert |
Subject: |
Re: Bug with AC_C_RESTRICT on non-GNU-C compiler when using GLIBC |
Date: |
Mon, 22 Feb 2016 23:09:49 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
Dwight Guth wrote:
We use GLIBC's header files, but we
do not define the __GNUC__ macro.
Ah, in that case there's a simple solution: your compiler should define
__GNUC__. That's what Clang does.
we could define __restrict as a
keyword equivalent to restrict. In fact that is probably what I am going to
have to do if we can't come to some kind of consensus here.
Even if we came to a consensus, it would take years for the fixes to propagate
everywhere and in the meantime your compiler's users would have problems. So
really, it needs to support __restrict and define __GNUC__, like Clang does.
This is
also consistent with the fact that the documentation generated in config.h
for AC_C_RESTRICT says "Do not define if restrict is supported directly."
(although this documentation seems inconsistent with the online
documentation, which correctly explains the current behavior).
Yes, that's a typo in that comment. It should say "supported only directly".
Anyway, does the attached hacky patch fix the problem?
0001-AC_C_RESTRICT-port-better-to-non-GCC-glibc.patch
Description: Text Data