Closed
Description
When compiling on MacOS, the C++ site update code generates pages of warnings:
siteupdate.cpp:527:4: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(fstr, ": %.2f mi", cr->mileage); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
I'm ok leaving it or replacing our sprintf
calls with snprintf
calls. A little of what I saw when searching around on this is that there are also some more C++-specific ways to achieve the same result.
Compiler version:
Apple clang version 14.0.0 (clang-1400.0.29.202) Target: arm64-apple-darwin21.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin