to be complete:
gcc11 complains with:
In function 'unit_vec2',
inlined from 'attempt_line_merge' at /home/eric/work/wine/dlls/d3dx9_36/mesh.c:5542:5:
/home/eric/work/wine/dlls/d3dx9_36/mesh.c:5511:12: warning: 'lastdir' may be used uninitialized [-Wmaybe-uninitialized]
5511 | return D3DXVec2Normalize(D3DXVec2Subtract(dir, pt2, pt1), dir);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/eric/work/wine/include/d3dx9.h:31,
from /home/eric/work/wine/dlls/d3dx9_36/d3dx9_private.h:32,
from /home/eric/work/wine/dlls/d3dx9_36/mesh.c:31:
/home/eric/work/wine/dlls/d3dx9_36/mesh.c: In function 'attempt_line_merge':
/home/eric/work/wine/include/d3dx9math.h:352:21: note: by argument 2 of type 'const D3DXVECTOR2 *' to 'D3DXVec2Normalize' declared here
352 | D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv);
| ^~~~~~~~~~~~~~~~~
/home/eric/work/wine/dlls/d3dx9_36/mesh.c:5527:25: note: 'lastdir' declared here
5527 | D3DXVECTOR2 curdir, lastdir;
| ^~~~~~~
as D3DXV2Normalize isn't symetrical in its arguments definition (first arg is const ptr as input, while second arg is ptr as output)
so gcc11 complains about passing as first arg (being a const ptr) an uninitialized object (it has no way of knowing that both args are aliased)
A+