[PATCH 0/1] MR172: dlls/win32u: fix gcc12's warnings (UB)

eric pouech (@epo) wine at gitlab.winehq.org
Thu Jun 2 04:56:45 CDT 2022


GCC12.* emits tons of warnings when compiling win32'u sysparam bits
These warnings stem from:
- a union of different structures
- allocating one instance of these structure and casting its address to a pointer to
  the union.

This is UB as the whole union should be allocated in order to be a valid
object.

I tried to keep the original goals:
- don't overallocate individual structures
- have an OO design (and avoid casting back & forth arguments in methods)
and implemented this fix by transforming (as argument to most of the methods)
- a pointer to an union of structs
into
- an union (passed by value) of pointers to structs

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/172



More information about the wine-devel mailing list