[Mesa-dev] [PATCH] nir: Fix anonymous union initialization with older GCC.

Jason Ekstrand jason at jlekstrand.net
Mon Jan 9 18:54:07 UTC 2017


Assuming it still builds on newer GCC,

Acked-by: Jason Ekstrand <jason at jlekstrand.net>

On Sun, Jan 8, 2017 at 9:26 AM, Vinson Lee <vlee at freedesktop.org> wrote:

> Fix this build error with GCC 4.4.7.
>
>   CC     nir/nir_opt_copy_prop_vars.lo
> nir/nir_opt_copy_prop_vars.c: In function ‘copy_prop_vars_block’:
> nir/nir_opt_copy_prop_vars.c:765: error: unknown field ‘deref’ specified
> in initializer
> nir/nir_opt_copy_prop_vars.c:765: warning: missing braces around
> initializer
> nir/nir_opt_copy_prop_vars.c:765: warning: (near initialization for
> ‘(anonymous).<anonymous>’)
> nir/nir_opt_copy_prop_vars.c:765: warning: initialization from
> incompatible pointer type
>
> Fixes: 62332d139c8f ("nir: Add a local variable-based copy propagation
> pass")
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/compiler/nir/nir_opt_copy_prop_vars.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c
> b/src/compiler/nir/nir_opt_copy_prop_vars.c
> index 8c24cd7..7f17469 100644
> --- a/src/compiler/nir/nir_opt_copy_prop_vars.c
> +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c
> @@ -762,7 +762,7 @@ copy_prop_vars_block(struct copy_prop_var_state *state,
>           } else {
>              value = (struct value) {
>                 .is_ssa = false,
> -               .deref = src,
> +               { .deref = src },
>              };
>           }
>
> --
> 1.7.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170109/7933ea66/attachment.html>


More information about the mesa-dev mailing list