__GNUC__ and __GNUC_MINOR__

Bruno Haible <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <3742939.9QDqUjpEd7@omega>
Hi Vladimir,

In this conditional expression:
((__GNUC__ >= 4) && (__GNUC_MINOR__ >= 5))
the conditional for GCC looks odd: it
 - includes versions 4.5, 4.6, 4.7, 4.8, 4.9
 - but excludes versions 5.4, 6.3, 7.1
which is probably not what you meant since GCC 5.4 is a successor of 4.9.

The usual way to write conditions like this is
  (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4))
or - not my preferred coding style -
  (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4)

Note that this doesn't help with clang on Mac OS X, since it defines
__GNUC__ = 4 and __GNUC_MINOR__ = 2.

Bruno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.