Am 02.08.2016 um 02:14 schrieb Guillaume Munch <g...@lyx.org>:
> 
> Le 02/08/2016 à 00:18, Richard Heck a écrit :
>> On 08/01/2016 06:49 PM, Guillaume Munch wrote:
>>> +#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
>> 
>> I meant to ask before: Even if we're requiring gcc >= 4.6 (right?), is
>> it worth changing this to:
>> 
>>> (__GNUC_MINOR__ <= 6)
>> 
>> just in case someone ever wanted to try to compile with 4.5? Or would
>> that be impossible anyway?
> 
> gcc 4.5 is going to fail because of ranged for-loops and user-defined
> move operators: https://gcc.gnu.org/gcc-4.5/cxx0x_status.html
> 
>> More generally, do we need something here for
>> other compilers?
> 
> 2.3 requires a C++11 "complier" (gcc 4.8, MSVC 2015, as for clang there
> was no decision on a minimal version as far as I remember, do not
> hesitate to correct me). For gcc 4.6 we made an exception until Ubuntu
> 12.04 is phased out, this is why I added the exceptional code. After gcc
> 4.6, gcc 4.8 will be the oldest on the market, which is why, I think, we
> do not worry about 4.7 (which would miss thread_local too).
> 
>> 
>> Actually, maybe a better way to do it would be to invert the test. E.g.:
>> 
>>> #if [CONDITIONS ARE GOOD]
>>>     thread_local QVector<QPoint> points(32);
>>> #else
>>>     static QVector<QPoint> points(32);
>>> #endif
> 
> Maybe, but this is really meant to be temporary.
> 
>> 
>> Maybe we could just add a test to configure to see whether we have
>> thread_local?
>> 
> 
> thread_local is part of C++11, so no need to test for it like
> make_unique (which is not part of C++11). Moreover, if we detected that
> a compiler does not implement it, I do not think that there's anything
> we could do about it.
> 
> Re the other message, vector<bool> is ok (at least now), unless there it
> is a rule to avoid it (but in this use case it would be for the
> principle only).

On my Mac with clang I cannot compile after this commit :(

src/frontends/qt4/GuiFontLoader.cpp:380:2: error: thread-local storage is not 
supported for the current target
        thread_local vector<bool> cache_set(NUM_FAMILIES, false);
src/frontends/qt4/GuiFontLoader.cpp:381:2: error: thread-local storage is not 
supported for the current target
        thread_local vector<bool> cache(NUM_FAMILIES, false);

http://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports
tries to explain why.

Stephan

Reply via email to