[Mesa-dev] [AppVeyor] mesa master #1090 failed

Jose Fonseca jfonseca at vmware.com
Thu Apr 28 11:26:04 UTC 2016


On 28/04/16 11:44, Jose Fonseca wrote:
> On 28/04/16 11:07, AppVeyor wrote:
>>
>>   Build mesa 1090 failed
>>   <https://ci.appveyor.com/project/jrfonseca-fdo/mesa/build/1090>
>>
>> Commit db07b46f2c by Samuel Iglesias Gonsálvez
>> <mailto:siglesias at igalia.com> on 4/26/2016 7:35 AM:
>> nir: Add lrp lowering for doubles in opt_algebraic\n\nSome hardware
>> (i965 on Broadwell generation, for example) does not support\nnatively
>> the execution of lrp instruction with double arguments.\n\nAdd
>> 'lower_flrp64' flag to lower this instruction in that case.\n\nv2:\n -
>> Rename lower_flrp_double to lower_flrp64 (Jason)\n - Fix typo (Jason)\n
>> - Adapt the code to define bit_size information in the
>> opcodes.\n\nSigned-off-by: Samuel Iglesias Gonsálvez
>> <siglesias at igalia.com>\nReviewed-by: Jason Ekstrand
>> <jason at jlekstrand.net>
>>
>> Configure your notification preferences
>> <https://ci.appveyor.com/notifications>
>
> The problem is the C99 field initializers in nir_builder.h:
>
> static inline nir_ssa_def *
> nir_imm_double(nir_builder *build, double x)
> {
>     nir_const_value v = { { .f64 = {x, 0, 0, 0} } };   <===========
>     nir_ssa_def *def = nir_build_imm(build, 1, 64, v);
>     return def;
> }
>
> This is valid C99, and is supported by MSVC C compiler, but its not
> standard C++ and is not supported by MSVC C++ compiler.
>
> And nir_builder.h is used by C++ source files too (e.g. glsl_to_nir.cpp
> )this is a problem.
>
> I'll see if there's any GNU C++ option we can use to throw an
> error/warning when this happen.

It looks like the only option that makes C++ warn is -pendantic:

In file included from src/compiler/nir/glsl_to_nir.cpp:30:0:
src/compiler/nir/nir_builder.h: In function ‘nir_ssa_def* 
nir_imm_double(nir_builder*, double)’:
src/compiler/nir/nir_builder.h:121:26: warning: ISO C++ does not allow 
C99 designated initializers [-Wpedantic]
     nir_const_value v = { { .f64 = {x, 0, 0, 0} } };
                           ^

Pedantic also causes other warnings that MSVC warns too:


In file included from src/compiler/nir/glsl_to_nir.h:28:0,
                  from src/compiler/nir/glsl_to_nir.cpp:28:
src/compiler/nir/nir.h:754:20: warning: ISO C++ forbids zero-size array 
‘src’ [-Wpedantic]
     nir_alu_src src[];
                     ^
In file included from src/compiler/nir/glsl_to_nir.h:28:0,
                  from src/compiler/nir/glsl_to_nir.cpp:28:
src/compiler/nir/nir.h:919:16: warning: ISO C++ forbids zero-size array 
‘src’ [-Wpedantic]
     nir_src src[];
                 ^

MSVC says:

c:\projects\mesa\src\compiler\nir\nir.h(754) : warning C4200: 
nonstandard extension used : zero-sized array in struct/union
         Cannot generate copy-ctor or copy-assignment operator when UDT 
contains a zero-sized array
c:\projects\mesa\src\compiler\nir\nir.h(919) : warning C4200: 
nonstandard extension used : zero-sized array in struct/union
         Cannot generate copy-ctor or copy-assignment operator when UDT 
contains a zero-sized array


But unfortunately pedantic causes a bit of noise.  See full log attached.

I'll post a series that fixes the build failure and tries to selectively 
  enable -Wpedantic.


Jose



-------------- next part --------------
A non-text attachment was scrubbed...
Name: pedantic.log
Type: text/x-log
Size: 26369 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160428/9076f066/attachment-0001.bin>


More information about the mesa-dev mailing list