This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Test for implementation-defined features of GCC
- From: Andrew Haley <aph at gcc dot gnu dot org>
- To: Vincent Lefevre <vincent+gcc at vinc17 dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 12 Apr 2007 17:03:23 +0100
- Subject: Re: Test for implementation-defined features of GCC
- References: <20070412155942.GA15776@vin.lip.ens-lyon.fr>
Vincent Lefevre writes:
> The GCC 4.1 manual says:
>
> 4.5 Integers
> ============
> [...] Signed `>>' acts on negative numbers by sign extension.
>
> but nothing is said about past and future GCC implementations. So,
> how can I test some implementation-defined features? For instance,
> something like:
>
> #ifdef SOME_MACRO_DEFINED_BY_GCC_IF_RIGHT_SHIFT_IS_WITH_SIGN_EXTENSION
> /* code that works only where signed `>>' acts on negative numbers by
> sign extension */
> #else
> /* fallback portable code (slower) */
> #endif
Autoconf does this kind of thing.
http://www.gnu.org/software/autoconf/
Andrew.