Re: __GNUC__ and __GNUC_MINOR__
Vladimir Tzankov <[email protected]>
| Newsgroups | gmane.lisp.clisp.devel |
|---|---|
| Message-ID | <CAHWYE6L_ttUMTsAhCu6hN6bR6RSfc=Db2q6+Ch6m01uxuk7dpw@mail.gmail.com> |
On Wed, May 31, 2017 at 1:52 AM, Bruno Haible <[email protected]> wrote: > 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) > Oops, my bad! Fixed. > Note that this doesn't help with clang on Mac OS X, since it defines > __GNUC__ = 4 and __GNUC_MINOR__ = 2. Yes, that's the reason I added explicit check for __clang__. ------------------------------------------------------------------------------ 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