Test for implementation-defined features of GCC

Vincent Lefevre vincent+gcc@vinc17.org
Thu Apr 12 15:59:00 GMT 2007


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

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



More information about the Gcc-help mailing list