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

Alejandro Piñeiro apinheiro at igalia.com
Tue Apr 26 12:09:09 UTC 2016


On 26/04/16 14:00, Ian Romanick wrote:
> Other than the formatting nits in patch 2, I think this series is fine.

Thanks for the feedback. I will update the patches and send a v2 soon.

>  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?

Well, I made what you suggest on a different patch series. I sent it
last week. I also made a ping today:
https://lists.freedesktop.org/archives/mesa-dev/2016-April/113808.html

>
> 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