jsonrpcx / json-rpc-cxx

JSON-RPC for modern C++
MIT License
251 stars 44 forks source link

Compiling fails with XCode 14.1 using MacOS 13.0 SDK #39

Closed naali closed 2 years ago

naali commented 2 years ago

sprintf() has been deprecated in MacOS 13.0 SDK causing warnings to be emitted and since warnings are treated as errors, compilation fails...

In file included from /Users/svenn/GITroot/pixie-base-dependencies/json-rpc-cxx/test/main.cpp:2:
/json-rpc-cxx/vendor/doctest/doctest.h:3725:1: error: '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. [-Werror,-Wdeprecated-declarations]
DOCTEST_TO_STRING_OVERLOAD(char, "%d")
^
/json-rpc-cxx/vendor/doctest/doctest.h:3721:14: note: expanded from macro 'DOCTEST_TO_STRING_OVERLOAD'
        std::sprintf(buf, fmt, in);                                                                \
             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.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.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
cinemast commented 2 years ago

Thank you for reporting. I will update doctest.

cinemast commented 2 years ago

Could you check if #40 solves it?

naali commented 2 years ago

Yes, with these patches everything compiles without problems :)