According to the spec, the compiler is free to use a signed, unsigned, or even char type for enums, provided all values fit within the type. For example, constructs like `*_FORCE_DWORD` can force an unsigned type using a value like `0xffffffff`. While some headers use this approach, it’s inconsistent and 0x7fffffff is often used instead.
Unfortunately, MSVC and GCC differ in their behavior: GCC always uses an unsigned type, while MSVC uses a signed type when possible. Consequently, Clang’s behavior depends on the mode being used.
Additionally, Clang emits a warning for "useless" checks when building Wine in MinGW mode. For instance: ``` dlls/gdiplus/graphics.c:7337:18: warning: result of comparison of unsigned enum expression < 0 is always false [-WTautological-unsigned-enum-zero-compare] 7337 | src_space < 0 || src_space > CoordinateSpaceDevice) ```
This warning is impractical for code that aims to be portable. The check is not tautological when building in MSVC mode (e.g., in our CI). I considered disabling the warning, but since this is the only place in the codebase where it’s problematic, I believe we can simply adjust the check.
This resolves the last warning in LLVM builds, allowing -Werror to be used in MinGW mode as well.