ssl: fix format specifier for size_t argument to BIO_printf #14521
Conversation
|
Do note that MSVC older than 2015 doesn't know %z |
Does MSVC throw errors if it encounters it? |
If compiled with |
|
I guess the universal fix would be to cast it to a known int type. Not sure I like this given we've got the z modifier. |
|
I was a bit confounded when I mentioned MSVC, I'm currently unsure that we ask it to check for format spec mismatches, so it's possible that this will fly unnoticed. Something to keep in mind, though, is that %z is C99, and we still proclaim that we are sticking to C90 for the language syntax, and while %z is handled by a library function (our own, to boot), we're still asking the compiler (at least gcc and clang) to check these format, which makes it a syntax problem. The proper universal fix would have been to use PRI macros (from <inttypes.h>)... except that such macros for size_t doesn't exist. However, that has never stopped us from rolling our own when needed, so an idea is to implement a macro PRIz with the appropriate format string (without percent). |
|
However we already use %zu throughout the code. |
|
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
|
Merged to master, thanks for the feed back. |
Fixes #14519