stb
stb copied to clipboard
Possible use of uninitialized value in stb_voxel_render.h?
I’m looking at a compiler warning:
In file included from test_c_compilation.c:30:
../stb_voxel_render.h: In function 'stbvox_make_mesh_for_block_with_geo':
../stb_voxel_render.h:3033:37: warning: 'rot' may be used uninitialized in this function [-Wmaybe-uninitialized]
3033 | rot = mm->input.packed_compact[rot] & 3;
| ^
It seems that rot
on the RHS could indeed be uninitialized if all of these are true:
-
mm->input
has null/falsegeometry
-
mm->input
has non-null/truepacked_compact
- the
STBVOX_CONFIX_ROTATION_IN_LIGHTING
macro is defined