Follow-up Comment #5, bug #20513 (project freeciv):
This is proving harder than I expected
- My MinGW compiler does not support "%zd" (C99 feature)
- We cannot rely on inttypes.h to exist, nor has it format identifier that is
guaranteed to match site_t on all platforms
- Casting size_t to unsigned long wouldn't work on win64 (we recently got that
otherwise supported) as there size_t is bigger than long
But myabe we are trying to fix wrong error here. Why those messages even are
like that? Look for dio_get_uint32(): It tries to read 4 bytes, and when it
fails, it tries to figure out number of bytes it tried to read with sizeof().
The same value should be used for both reading and to be in log message.
Either we get it to variable and use that variable, or we use same hardcoded
value for both. Given the problem in this ticket, we should go by hardcoding.
We can/should move the fc_assert(sizeof(x) == 4) earlier in the function,
before one tries to read 4 bytes to sizeof(x) block.
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list