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

Jan Vesely jan.vesely at rutgers.edu
Wed Nov 26 11:16:02 PST 2014


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

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

jan

> 
> This change disables them.
> ---
>  scons/gallium.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scons/gallium.py b/scons/gallium.py
> index 8e2090b..d9bf760 100755
> --- a/scons/gallium.py
> +++ b/scons/gallium.py
> @@ -462,6 +462,7 @@ def generate(env):
>              ]
>          ccflags += [
>              '/W3', # warning level
> +            '/wd4018', # signed/unsigned mismatch
>              '/wd4244', # conversion from 'type1' to 'type2', possible loss of data
>              '/wd4305', # truncation from 'type1' to 'type2'
>              '/wd4800', # forcing value to bool 'true' or 'false' (performance warning)

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141126/a76828da/attachment.sig>


More information about the mesa-dev mailing list