From e3304734a68a190452ffd906a0ba3f52bc124301 Mon Sep 17 00:00:00 2001 From: Phil Deets Date: Fri, 14 Nov 2025 19:48:15 -0800 Subject: [PATCH] Fix unchecked lower bound warning in get_default_error_string. --- include/boost/regex/v5/regex_traits_defaults.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/regex/v5/regex_traits_defaults.hpp b/include/boost/regex/v5/regex_traits_defaults.hpp index 1cd7adc18..8f29a34e3 100644 --- a/include/boost/regex/v5/regex_traits_defaults.hpp +++ b/include/boost/regex/v5/regex_traits_defaults.hpp @@ -148,7 +148,8 @@ inline const char* get_default_error_string(regex_constants::error_type n) "Unknown error.", /* REG_E_UNKNOWN 21 error_unknown */ }; - return (n > ::boost::regex_constants::error_unknown) ? s_default_error_messages[::boost::regex_constants::error_unknown] : s_default_error_messages[n]; + typedef typename std::make_unsigned::type unsigned_type; + return (static_cast(n) > ::boost::regex_constants::error_unknown) ? s_default_error_messages[::boost::regex_constants::error_unknown] : s_default_error_messages[n]; } inline regex_constants::syntax_type get_default_syntax_type(char c)