<div dir="ltr">On 26 October 2013 00:47, Timothy Arceri <span dir="ltr"><<a href="mailto:t_arceri@yahoo.com.au" target="_blank">t_arceri@yahoo.com.au</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, 2013-10-25 at 14:51 -0700, Paul Berry wrote:<br>
<br>
<br>
+   _mesa_glsl_error(&loc, state,<br>
>         +                    is_initializer ? "initializer" : "value"<br>
>         +                    " of type %s cannot be assigned to "<br>
>         +                    "variable of type %s",<br>
>         +                    rhs->type->name, lhs_type->name);<br>
>         +<br>
>         <br>
><br>
> This doesn't produce the output you want.  String concatenation happens at compile time and takes precedence over everything else, so this is being interpreted as:<br>
><br>
><br>
> _mesa_glsl_error(&loc, state, is_initializer ? "initializer" : "value of type %s cannot be assigned to variable of type %s", rhs->type->name, lhs_type->name);<br>
><br>
><br>
> Adding parenthesis doesn't help because string concatenation only works on string literals.  I believe what you actually want is:<br>
><br>
>    _mesa_glsl_error(&loc, state,<br>
>                     "%s of type %s cannot be assigned to "<br>
>                     "variable of type %s",<br>
>                     is_initializer ? "initializer" : "value",<br>
>                     rhs->type->name, lhs_type->name);<br>
><br>
<br>
</div>Yes that makes sense thanks.<br>
<div class="im"><br>
>With that change, this patch is:<br>
><br>
><br>
> Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
><br>
><br>
> Do you have push access?  I can push the patch for you (with this change) if you'd like.<br>
><br>
<br>
</div>No I don't have push access. Would be great if you could push this with the change.<br>
<br>
Thanks for the review.<br>
<br>
Tim<br>
</blockquote></div><br></div><div class="gmail_extra">Ok, I've pushed it upstream.<br></div></div>