bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_C_RESTRICT should prioritize the standard restrict keyword first


From: Steven Stewart-Gallus
Subject: AC_C_RESTRICT should prioritize the standard restrict keyword first
Date: Sun, 10 Aug 2014 21:02:22 +0000 (GMT)

The AC_C_RESTRICT macro should prioritize the standard restrict keyword first
instead of __restrict or any other.

The problem with going with alternate versions of restrict instead of the
standard keyword first is that the alternatives have possibly different
behaviours from the standard. As well, this complicates static analysis of the
source which shouldn't have to work around a bunch of non-standard spellings
(static analysis tools should also analyse as close as possible a configuration
of the host compiler instead of analysing a separate configuration for them).
Moreover, redefining restrict is technically undefined behaviour if the compiler
provides it.

To work around the issue that __restrict would be more portable to C++ compilers
an AC_CXX_RESTRICT macro should be made instead of having AC_C_RESTRICT serve
two purposes. Alternatively, the language pushing and popping mechanism should
be used.

Thank you,
Steven Stewart-Gallus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]