Closed rplsix closed 1 year ago
Hi, it's not that simple since there's no snprintf in C89. You can use -Wno-deprecated-declarations
.
Also, sizeof(num_buf)
is wrong.
macOS by default uses clang, so using pragmas can be a workaround
#ifdef __APPLE__
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
/* sprintf(...) function */
#pragma clang diagnostic pop
#endif
#endif
There's another thing can be done is to create another function that behaves like a snprintf(...)
; a custom variadic function using vsnprintf(...)
. Though it's not a part of C89 spec.
Error given if compiling on MacOS:
Affected are these lines starting at 1247:
If changed to this it would be compiling: