From 87d678f5241a9fa67799ee26415b9387cfa7cc8a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 19 Feb 2024 09:16:06 +0100 Subject: [PATCH] sgml: dismiss MSVC warnings Brain-dead _Printf_format_string_ SAL doesn't understand utf32_t is good enough for unsigned int expected by %x placeholder. Signed-off-by: Simon Rozman --- include/stdex/sgml.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/stdex/sgml.hpp b/include/stdex/sgml.hpp index f7fa65f24..9388917b6 100644 --- a/include/stdex/sgml.hpp +++ b/include/stdex/sgml.hpp @@ -618,7 +618,7 @@ namespace stdex unicode = src[i++]; } char tmp[3 + 8 + 1 + 1]; - snprintf(tmp, _countof(tmp), "&#x%x;", unicode); + snprintf(tmp, _countof(tmp), "&#x%x;", static_cast(unicode)); dst.append(tmp); } } @@ -760,7 +760,7 @@ namespace stdex unicode = src[i++]; } char tmp[3 + 8 + 1 + 1]; - int m = snprintf(tmp, _countof(tmp), "&#x%x;", unicode); + int m = snprintf(tmp, _countof(tmp), "&#x%x;", static_cast(unicode)); _Assume_(m >= 0); if (static_cast(m) >= count_dst) throw buffer_overrun;