[Mesa-dev] Mesa (master): glsl: Fix ' format not a string literal and no format arguments' warning.

Ian Romanick idr at freedesktop.org
Thu Sep 16 06:31:42 PDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vinson Lee wrote:
> Module: Mesa
> Branch: master
> Commit: f20f2cc3306310f6fc4c338f91cfac10f98335d3
> URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f20f2cc3306310f6fc4c338f91cfac10f98335d3
> 
> Author: Vinson Lee <vlee at vmware.com>
> Date:   Wed Sep 15 05:17:57 2010 -0700
> 
> glsl: Fix 'format not a string literal and no format arguments' warning.
> 
> Fix the following GCC warning.
> loop_controls.cpp: In function 'int calculate_iterations(ir_rvalue*, ir_rvalue*, ir_rvalue*, ir_expression_operation)':
> loop_controls.cpp:88: warning: format not a string literal and no format arguments
> 
> ---
> 
>  src/glsl/loop_controls.cpp |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp
> index 9619d8a..2ef3d30 100644
> --- a/src/glsl/loop_controls.cpp
> +++ b/src/glsl/loop_controls.cpp
> @@ -85,7 +85,7 @@ int
>  calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
>  		     enum ir_expression_operation op)
>  {
> -   void *mem_ctx = talloc_init(__func__);
> +   void *mem_ctx = talloc_init("%s", __func__);

If __func__ is not showing up as a string literal, something else is
wrong.  This is supposed to be a #define generated by the compiler.  Is
this  a case where we're wrapping __func__ for Visual Studio and
something is going wrong (since this is GCC)?  I also find this odd
because I don't get this warning on my builds... and I enable a lot of
extra warning flags.

>  
>     ir_expression *const sub =
>        new(mem_ctx) ir_expression(ir_binop_sub, from->type, to, from);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkySHDsACgkQX1gOwKyEAw/n/ACePdgvPa0xwSs02PqSQdnTF1pr
HekAn07NDlPtU2bvUGQSf1W0tFLtOWa1
=R3UQ
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list