[Mesa-dev] [PATCH] nir/builder: fix C90 build errors

Jose Fonseca jfonseca at vmware.com
Mon Dec 21 07:51:41 PST 2015


On 19/12/15 22:39, Rob Clark wrote:
> From: Rob Clark <robclark at freedesktop.org>
>
> We are going to start using nir_builder.h from some gallium code, which
> is currently only C90.

Which parts of gallium are you referring to?

 > Which results in:
>
>     In file included from nir/nir_emulate.c:26:0:
>     ../../../src/glsl/nir/nir_builder.h: In function ‘nir_build_alu’:
>     ../../../src/glsl/nir/nir_builder.h:132:4: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
>         unsigned num_components = op_info->output_size;
>         ^
>     In file included from nir/nir_emulate.c:26:0:
>     ../../../src/glsl/nir/nir_builder.h: In function ‘nir_ssa_for_src’:
>     ../../../src/glsl/nir/nir_builder.h:271:4: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
>         nir_alu_src alu = { NIR_SRC_INIT };
>         ^
>     cc1: some warnings being treated as errors
>
> Signed-off-by: Rob Clark <robclark at freedesktop.org>
> ---
> Not sure if I should just go ahead and push this sort of thing.  Or
> if we can start requiring C99 for gallium?

No, I'm afraid that universally requiring C99 is not yet an option.

llvmpipe, gallium includes, gallium auxiliary, and src/util must 
continue to be buildable with non-C99 MSVC 2008.

It's already a very small subset of Mesa.


The good news is that work to migrate away from MSVC 2008 has started. 
I can't give an ETA yet (it depends on lots of different teams, so it 
could take any time really -- months years), but it's a start.


I'm also hoping in the long term, if Microsoft goes through with its 
plan to integrate Clang frontend into MSVC, we can just use that 
instead. It's still a far way off, but nevertheless one of my top 
requests for Santa.


Jose


More information about the mesa-dev mailing list