5 ms·
GCC undefined behaviors are getting wild
- xeeeeeeeeeeenu 4y agoIf you want signed integer overflow to be defined, use the "-fwrapv" flag.
- suprjami 4y agoI really like the idea of decompiling ones' own code with Ghidra to see different ways the logic can be represented. Using `-Wextra` adds a warning about the signed\unsigned comparison, but Ghidra's `(ulong)(uint)` casts make that a bit clearer.
- llimos 4y agoThis is a great writeup on what's possible with undefined behavior https://devblogs.microsoft.com/oldnewthing/20140627-00/?p=633 https://devblogs.microsoft.com/oldnewthing/20140627-00/?p=63...