[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Incompatibilities with clang.
From: |
Paul Eggert |
Subject: |
Re: Incompatibilities with clang. |
Date: |
Sun, 03 Nov 2013 11:01:28 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
Matt Sicker wrote:
> #ifndef __has_feature
> #define __has_feature(x) 0
> #endif
> #if __has_feature(c_static_assert)
> ...
> #endif
Well, obviously that won't work with anything *but* clang,
but before we fix that, the web page in question talks about
both __has_feature(c_static_assert) and __has_extension(c_static_assert).
What's the difference, and why should we care? Also, can we use just
one of those two and not worry about __has_feature(cxx_static_assert)
and __has_extension(cxx_static_assert), even when compiling in C++
mode? That's the sort of thing that I was talking about
when I wrote that the documentation was unclear.
This isn't all that high-priority, since gnulib currently *is*
compatible with clang (despite the Subject: line); it's just
that compile-time checking is better with GCC than with Clang
in some cases.