GCC std::array uses std::size_t for its size_type. On Linux/amd64, `std::size_t` is `unsigned long`. On Win32, `std::size_t` is `unsigned int`. This provokes format string warnings because an unsigned int is passed where the format string declares an unsigned long. On Win32, `unsigned int` and `unsigned long` are the same size, so `unsigned long` could have been used to avoid this problem by maintaining consistency with Linux, but it was not. This may have been an attempt to achieve bug compatibility with Microsoft's types. Add a workaround by defining a macro DXX_PRI_size_type in the style of inttypes.h PRI* macros. Use an SConf test to determine the correct value by inspecting which compilation runs succeed. Currently, Linux needs "l", Win32 needs "", and Win64 needs "I64". |
||
---|---|---|
.. | ||
2d | ||
3d | ||
arch | ||
editor | ||
main | ||
misc |