dxx-rebirth/common
Kp bace343437 Fix gcc-11 warning -Wmaybe-uninitialized on input array
For gcc bug #10138 [1], gcc-11 gained a new way to show a
-Wmaybe-uninitialized warning.  When an uninitialized array is passed by
`const T *` to a function, gcc-11 assumes the array is an input to the
function, and warns accordingly.  This is often useful, but is incorrect
for the Rebirth partial_range code.  In this code, the pointer is only
passed so that the eventual exception can print the memory address of
the affected array.  The called function does not dereference the
pointer, and so cannot be influenced by any uninitialized values in the
underlying array.

Change the report function to take the array address in a `uintptr_t`,
and cast it back for printing.  This silences the gcc-11 warning, while
preserving the previous semantics in the code.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138
2020-12-14 00:04:41 +00:00
..
2d Add color_palette_index type alias, to note palette-related uint8_t 2020-07-16 02:31:04 +00:00
3d clipper.cpp: Fix build with gcc10 2020-06-09 22:23:48 +02:00
arch Remove send_creation_events parameter 2020-10-22 02:26:16 +00:00
editor Use std::array for editor mine filename 2020-10-12 03:28:25 +00:00
include Fix gcc-11 warning -Wmaybe-uninitialized on input array 2020-12-14 00:04:41 +00:00
main Restore buffering on PCX loads 2020-11-30 05:12:00 +00:00
maths Qualify uses of std::array 2020-05-02 21:18:42 +00:00
mem Refer to <array> directly, not through "compiler-array.h" 2020-05-02 21:18:42 +00:00
misc Restore buffering on PCX loads 2020-11-30 05:12:00 +00:00
music Rework ADL dynamic loader 2018-10-15 00:51:53 +00:00
texmap Refer to <array> directly, not through "compiler-array.h" 2020-05-02 21:18:42 +00:00
ui Remove send_creation_events parameter 2020-10-22 02:26:16 +00:00
unittest Add unit tests for serialization code 2020-05-17 23:35:25 +00:00