edc3b93c9b
x86_64-w64-mingw32-g++ -Wformat handling misparses the std::size_t format string, causing a spurious error. common/main/valptridx.tcc: In function 'void untyped_index_mismatch_exception::prepare_report(const char*, unsigned int, const void*, long int, const void*, const void*, char (&)[229], std::size_t)': common/main/valptridx.tcc:36:182: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'std::size_t {aka long long unsigned int}' [-Werror=format=] This occurs even though the processed text uses %I64u (which is correct for a `long long unsigned int`), not %u as shown in the error message. static void prepare_report(const char *const filename, const unsigned lineno, const void *const array_base, const long supplied_index, const void *const expected_pointer, const void *const actual_pointer, char (&buf)[report_buffer_size], const std::size_t array_size) { snprintf(buf, sizeof(buf), "%s:%u: " "pointer/index mismatch:" " base=%p size=%" "I64u" " index=%li expected=%p actual=%p", filename, lineno, array_base, array_size, supplied_index, expected_pointer, actual_pointer); } In practice, all such sizes will fit in `unsigned int` because they are the dimension of an array of large structures. Switch all platforms to use `unsigned long`, which works everywhere and is at least as big as `unsigned int`. Using `unsigned long` produces the same size as `std::size_t` on all platforms other than Win64, where `unsigned long` is only 32 bits due to the strange LLP64 model Microsoft picked. |
||
---|---|---|
.. | ||
ai.h | ||
aistruct.h | ||
automap.h | ||
bm.h | ||
cli.cpp | ||
cli.h | ||
cmd.cpp | ||
cmd.h | ||
cntrlcen.h | ||
collide.h | ||
config.h | ||
controls.h | ||
credits.h | ||
cvar.cpp | ||
cvar.h | ||
d_enumerate.h | ||
digi.h | ||
effects.h | ||
endlevel.h | ||
escort.h | ||
fireball.h | ||
fuelcen.h | ||
fvi.h | ||
fwd-object.h | ||
fwd-player.h | ||
fwd-segment.h | ||
fwd-wall.h | ||
fwd-weapon.h | ||
game.h | ||
gamefont.h | ||
gamemine.h | ||
gamepal.h | ||
gamesave.h | ||
gameseg.h | ||
gameseq.h | ||
gauges.h | ||
hostage.h | ||
hudmsg.h | ||
inferno.h | ||
kconfig.h | ||
kmatrix.h | ||
laser.h | ||
lighting.h | ||
menu.h | ||
mission.h | ||
morph.h | ||
multi.h | ||
multibot.h | ||
multiinternal.h | ||
net_udp.h | ||
newdemo.h | ||
newmenu.h | ||
nvparse.h | ||
object.h | ||
objnum.h | ||
paging.h | ||
physics.h | ||
piggy.h | ||
player-callsign.h | ||
player-flags.h | ||
player.h | ||
playsave.h | ||
polyobj.h | ||
powerup.h | ||
render.h | ||
render_state.h | ||
robot.h | ||
scores.h | ||
screens.h | ||
segiter.h | ||
segment.h | ||
segpoint.h | ||
slew.h | ||
songs.h | ||
sounds.h | ||
state.h | ||
switch.h | ||
terrain.h | ||
texmerge.h | ||
text.h | ||
textures.h | ||
titles.h | ||
valptridx.tcc | ||
vclip.h | ||
vers_id.h | ||
wall.h | ||
weapon.h | ||
weapon_id.h |