[Mesa-dev] [PATCH 0/2] glsl: solve "uninitialized variable" warning false positive with function parameters

Ian Romanick idr at freedesktop.org
Tue Apr 26 12:00:16 UTC 2016


Other than the formatting nits in patch 2, I think this series is fine.
 One nagging problem... we don't have any way to test this, and, as a
result, none of it is tested.  Can we fix that?  There are 'make check'
tests in the Mesa tree for the preprocessor.  Could we hook up something
like that to test these warnings?

On 04/19/2016 07:48 PM, Alejandro Piñeiro wrote:
> This series solves the false positive that Ilia found recently.
> 
> On the thread I mention that my preferred option would be try to set
> is_lhs before processing the function parameters on a pass similar to
> verify_parameter_modes, in order to avoid two different places raising
> the same warning. This is not possible because it is needed to process
> the parameters in order to match for the correct signature.
> 
> Worth to mention that at his point is_lhs probably has lost his
> original meaning, and would be good to rename it. But I didn't find a
> good alternative name, so Im letting it as it is.
> 
> Finally, this warning showed to involve several corner cases, so I
> think that it would be good to add some unit tests. At this point I
> think that the simpler would be have some small shaders and .expected
> files. The check would just execute glsl_compiler and compare the
> output with those .expected files (this would be similar to the glcpp
> tests).
> 
> Alejandro Piñeiro (2):
>   glsl: add a empty set_is_lhs on ast_node
>   glsl: do not raise uninitialized warning with in/inout function
>     parameters
> 
>  src/compiler/glsl/ast.h            |  2 ++
>  src/compiler/glsl/ast_function.cpp | 18 ++++++++++++++++++
>  src/compiler/glsl/ast_to_hir.cpp   |  5 +++++
>  3 files changed, 25 insertions(+)
> 



More information about the mesa-dev mailing list