[Mesa-dev] [PATCH 1/8] nir: Silence missing field initializer warnings for nir_src

Timothy Arceri timothy.arceri at collabora.com
Wed Dec 16 19:50:50 PST 2015


On Tue, 2015-12-15 at 22:44 -0800, Jason Ekstrand wrote:
> On Dec 14, 2015 3:34 PM, "Ian Romanick" <idr at freedesktop.org> wrote:
> >
> > From: Ian Romanick <ian.d.romanick at intel.com>
> >
> > nir/nir.h: In function 'nir_src_for_ssa':
> > nir/nir.h:552:4: warning: missing initializer for field 'use_link'
> of 'nir_src'
> > [-Wmissing-field-initializers]
> >     nir_src src = NIR_SRC_INIT;
> >     ^
> > In file included from nir/nir.c:28:0:
> > nir/nir.h:508:21: note: 'use_link' declared here
> >     struct list_head use_link;
> >                      ^
> >
> > Number of total warnings in my build reduced from 2329 to 1932
> > (reduction of 397).
> Is there some reason why you're building with extra warnings?  Last I
> looked, all of NIR compiles with zero warnings with default flags so
> the "removes compiler warnings" argument falls flat when the code is
> perfectly well-defined. 
Just on this I build without adding extra warning flag and seem to be
seeing issues that no-one else is, either that or people are ignoring
warnings when pushing code and not fixing it after.
I fixed 4b9a79b7b813b the other day after the warning seemed to have
been around for a couple of weeks.
I pulled this morning and now I have this in nir:
brw_vue_map.c: In function 'brw_print_vue_map':
brw_vue_map.c:260:20: warning: array subscript is above array bounds [
-Warray-bounds]
    return brw_names[slot - VARYING_SLOT_MAX];
And this in GLSL IR:
lower_buffer_access.cpp: In member function 'bool
lower_buffer_access::lower_buffer_access::is_dereferenced_thing_row_maj
or(const ir_rvalue*)':
lower_buffer_access.cpp:286:26: warning: unused variable 'var' [
-Wunused-variable]
             ir_variable *var = deref->variable_referenced();
I'm using gcc 5.3.1 and running Fedora if it makes any difference. 
>  What utility does building with -wextra actually provide?
> 
> If this serves no purpose other than alleviating your personal annoyance with your preferred extra flags, then I'm going to have to nak it.  I'm not being territorial, I just don't see any point in adding complexity for the sake of -wextra.
> 
> --Jason

> _______________________________________________
> mesa-dev mailing list
> 
mesa-dev at lists.freedesktop.org> 
http://lists.freedesktop.org/mailman/listinfo/mesa-dev> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151217/db3c49fd/attachment.html>


More information about the mesa-dev mailing list