On Mon Aug 14 18:12:10 2023 +0000, Francisco Casas wrote:
This gives a compiler warning:
vkd3d/libs/vkd3d-shader/hlsl.c: In function ‘hlsl_new_string_constant’: vkd3d/libs/vkd3d-shader/hlsl.c:1236:12: warning: ‘value’ may be used uninitialized [-Wmaybe-uninitialized] 1236 | return hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_STRING), &value, loc); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vkd3d/libs/vkd3d-shader/hlsl.c:1208:22: note: by argument 3 of type ‘const struct hlsl_constant_value *’ to ‘hlsl_new_constant’ declared here 1208 | struct hlsl_ir_node *hlsl_new_constant(struct hlsl_ctx *ctx, struct hlsl_type *type, | ^~~~~~~~~~~~~~~~~ vkd3d/libs/vkd3d-shader/hlsl.c:1235:32: note: ‘value’ declared here 1235 | struct hlsl_constant_value value;
My guess is that you want to initialize value to just zeroes.
struct hlsl_constant_value value = {};
Huh it doesn't give me that error on my machine. Good catch.