[Mesa-dev] swr forces c++11 for whole compilation

Jose Fonseca jfonseca at vmware.com
Wed Apr 13 14:11:19 UTC 2016


On 13/04/16 14:21, Ilia Mirkin wrote:
> On Wed, Apr 13, 2016 at 8:48 AM, Jose Fonseca <jfonseca at vmware.com> wrote:
>> On 13/04/16 11:43, Ilia Mirkin wrote:
>>>
>>> Hi Tim,
>>>
>>> It seems like building swr forces c++11 mode for the whole build, even
>>> other drivers being built that aren't necessarily ready for it.
>>> Unfortunately c++11 isn't backwards compatible with c++03, so the switch
>>> can't be made unilaterally. Could you have a look at why this is
>>> happening?
>>>
>>> An example of something that does this properly is clover, which also
>>> requires c++11 to be built.
>>>
>>> Thanks,
>>>
>>>     -ilia
>>>
>>
>> Ilia,
>>
>> Even before SWR was merged and today's isinf fix was commited,
>> nv50_ir_ra.cpp already has code to make it portable for C++11 (see below).
>>
>> I honestly don't understand what you're trying to achieve with this
>> thread...
>
> Build options required for a specific driver to stay with that driver
> and not affect other drivers.
>
>>
>> Are you seriously plan to require C++03 to build nouveau?  It would be
>> insane try to do that once GCC 6 is widely available.
>
> -std=c++03 (or something like that) will presumably work just fine?

I wouldn't label it "just fine".  Soon everybody will be using C++11 or 
higher, either because it's the default (GCC 6.0, MSVC 2013/2015), or 
because some dependency uses it.  So if you use -std=c++03 only in a 
portion of the tree, you'll inherit the hassle of fixing mesa/include 
and mesa/src/util for C++03 when nobody else bothers...

>>
>> Rather than see you swimming upstream, I much rather see you helping me
>> helping you to keep nouveau C++11 portable...
>
> That'd be nice, but to be perfectly honest, I haven't kept up with all
> the changes in C++11, as my professional work has caused me to stray
> from my (preferred) C/C++ roots. From what I understand, on top of
> syntactic and library changes, it also changes the semantics of how
> things are passed around, as part of adding the FooType&& concept. I
> don't really want to go back and audit everything to make sure it's
> happy with C++11.

I only started reading about modern C++11/14 recently, so I'm not an 
expert by any account.  But from what I can gather, although it's 
possible the new semantics silently break old code, it seems that it's 
very rare.

   http://stackoverflow.com/a/9779379
   http://stackoverflow.com/a/6399720

FWIW, Microsoft 2013/2015 doesn't allow to choose C++03.


Jose


More information about the mesa-dev mailing list