[Mesa-dev] [PATCH 3/9] scons: Disable MSVC signed/unsigned mismatch warnings.

Jose Fonseca jfonseca at vmware.com
Wed Nov 26 12:01:10 PST 2014


On 26/11/14 19:16, Jan Vesely wrote:
> On Wed, 2014-11-26 at 18:47 +0000, jfonseca at vmware.com wrote:
>> From: José Fonseca <jfonseca at vmware.com>
>>
>> Unfortunately gcc completely ignores the issue, and as result code that
>> mixes signed/unsigned is so widespread through the code base end up
>> being little more than noise, potentially obscuring more pertinent
>> warnings.
>
> gcc does not ignore the issue. there is -Wsign-compare. it's part of
> -Wextra (and thus disabled by default). I build mesa with -Wextra (and
> -Wno-unused-paramter) and my setup adds these warnings:
>
> 154 -Wmissing-field-initializers
> 1 -Wold-style-declaration
> 614 -Wsign-compare
> 8 -Wtype-limits

Thanks for this info.

> I think it might be worth fixing these and and adding -Wextra to gcc
> build flags.

Yeah, these signed/unsigned compare warnings have some utility. 
Particularly to ensure the code is robust to invalid or very large 
parameters, ie. the sort of thing that could lead to security bugs.

On the other hand, "614" is a large number of places to fix..  Fixing 
them is not something I feel entitled to impose upon others.

But if people are game, I'm game too.

I'll withhold this patch for now, to let people think about this, and 
investigate a bit further myself how much overlap is there between MSVC 
and GCC warnings for this.

Jose





More information about the mesa-dev mailing list