Closed CasualPokePlayer closed 1 week ago
Could you point me to specific examples of this?
Don't know where the code is actually relying on it. The issue is just visible if you compile the code with the latest clang, and goes away if you add -fwrapv.
Putting this as an issue here, this issue first was noticed in BizHawk builds (now fixed) although still shows up in upstream melonDS (using clang 18.1.6). The issue ends up manifesting into weird rendering issues with the software renderer.
Fix would be either putting in
-fwrapv
or bumping up the C++ standard to C++20 (where 2's complement is mandated and various UB shift operations are no longer UB). The latter option appears to have unrelated build failures, so the former seems like a simpler fix.