dxx-rebirth/similar
Kp 5e52d11fc6 Discourage spurious gcc warning
gcc-12 can issue `-Warray-bounds` warnings for code inlined from system
headers, and warns about `std::sort()` on a small array (
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107986> split from
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104165>).  Per a comment
in a related Fedora report
<https://bugzilla.redhat.com/show_bug.cgi?id=2051783#c3>, and local
testing, adding an explicit unreachable on the impossible case that the
end iterator exceeds the end of the array will discourage gcc from
warning without needing to disable -Warray-bounds.

This failure was previously observed in early testing with gcc-12, and
was set aside in the hope that gcc-12 would be fixed before it came into
widespread use.  That has not happened, and JoeNotCharles reported
<2644e0cb93>
this independently.  JoeNotCharles proposed disabling the warning for
the call to `std::sort`.  This commit instead leaves the warning
enabled, but encourages gcc to see that the bad path is impossible,
allowing gcc to delete the bad path before the warning is issued.
2023-01-14 19:05:37 +00:00
..
2d Make enumerate inherit ranges::subrange directly 2022-12-31 16:21:47 +00:00
3d Remove inline stub for swap_polygon_model_data 2023-01-07 22:17:31 +00:00
arch Use correct coefficient table for 11Khz sounds 2023-01-08 14:19:52 +00:00
editor Make partial_range_t inherit from ranges::subrange 2023-01-14 19:05:37 +00:00
main Discourage spurious gcc warning 2023-01-14 19:05:37 +00:00
misc Move SysNoHogDir to CGameArg 2023-01-07 22:17:31 +00:00