Adjust the workaround for -pedantic mode and fix tests
This commit is contained in:
parent
8be081fbbe
commit
b6b747244e
@ -143,8 +143,8 @@ using std::memset;
|
|||||||
# define PUGI__SNPRINTF(buf, ...) snprintf(buf, sizeof(buf), __VA_ARGS__)
|
# define PUGI__SNPRINTF(buf, ...) snprintf(buf, sizeof(buf), __VA_ARGS__)
|
||||||
#elif defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400
|
#elif defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400
|
||||||
# define PUGI__SNPRINTF(buf, ...) _snprintf_s(buf, _countof(buf), _TRUNCATE, __VA_ARGS__)
|
# define PUGI__SNPRINTF(buf, ...) _snprintf_s(buf, _countof(buf), _TRUNCATE, __VA_ARGS__)
|
||||||
#elif defined(__APPLE__) && __clang_major__ >= 14 && !defined(__STRICT_ANSI__) // Xcode 14 marks snprintf as deprecated while still using C++98 by default
|
#elif defined(__APPLE__) && __clang_major__ >= 14 // Xcode 14 marks snprintf as deprecated while still using C++98 by default
|
||||||
# define PUGI__SNPRINTF(buf, ...) snprintf(buf, sizeof(buf), __VA_ARGS__)
|
# define PUGI__SNPRINTF(buf, fmt, arg1, arg2) snprintf(buf, sizeof(buf), fmt, arg1, arg2)
|
||||||
#else
|
#else
|
||||||
# define PUGI__SNPRINTF sprintf
|
# define PUGI__SNPRINTF sprintf
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -737,7 +737,7 @@ struct temp_file
|
|||||||
{
|
{
|
||||||
static int index = 0;
|
static int index = 0;
|
||||||
|
|
||||||
#if __cplusplus >= 201103
|
#if __cplusplus >= 201103 || defined(__APPLE__) // Xcode 14 warns about use of sprintf in C++98 builds
|
||||||
snprintf(path, sizeof(path), "%stempfile%d", test_runner::_temp_path, index++);
|
snprintf(path, sizeof(path), "%stempfile%d", test_runner::_temp_path, index++);
|
||||||
#else
|
#else
|
||||||
sprintf(path, "%stempfile%d", test_runner::_temp_path, index++);
|
sprintf(path, "%stempfile%d", test_runner::_temp_path, index++);
|
||||||
|
|||||||
@ -796,7 +796,7 @@ struct test_walker: xml_tree_walker
|
|||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
#if __cplusplus >= 201103
|
#if __cplusplus >= 201103 || defined(__APPLE__) // Xcode 14 warns about use of sprintf in C++98 builds
|
||||||
snprintf(buf, sizeof(buf), "%d", depth());
|
snprintf(buf, sizeof(buf), "%d", depth());
|
||||||
#else
|
#else
|
||||||
sprintf(buf, "%d", depth());
|
sprintf(buf, "%d", depth());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user