codelite
codelite copied to clipboard
Fix warning about `printf`:
- warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type
std::size_t.
Why not %zu instead? :)
Not familiar enough with printf format. I know that std::size_t might be of different size, warning suggests %ld as fix, so wrong for other size. Not sure neither if %zu is supported by all compiler...
Testing via GodBolt it seems it should be supported on: Clang 5, GCC 5, djgpp 5.5, icc 16, icx 2021, MSVC 19, nvc++ 22, FRC, TI CL430, Zapcc
It appears that it's more common for compilers to not support C++17 then %zu.