From: wanglinke Date: Thu, 26 Jun 2025 09:48:19 +0000 (+0800) Subject: src/common: fix from_iso_8601 had no exception define X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=72bbe28ad8744d6d3c7490881e35ce3dafddfc18;p=ceph.git src/common: fix from_iso_8601 had no exception define - from_iso_8601 may actually throw exceptions, causing the program to terminate. Signed-off-by: Wang Linke --- diff --git a/src/common/iso_8601.cc b/src/common/iso_8601.cc index 74c8aeafbe8b..9d45fadf510e 100644 --- a/src/common/iso_8601.cc +++ b/src/common/iso_8601.cc @@ -49,7 +49,7 @@ optional calculate(const tm& t, uint32_t n = 0) { } optional from_iso_8601(const string_view s, - const bool ws_terminates) noexcept { + const bool ws_terminates) { auto end = s.cend(); auto read_digit = [end](sriter& c) mutable { if (c == end) { diff --git a/src/common/iso_8601.h b/src/common/iso_8601.h index 430e584ab944..dcdf324557a4 100644 --- a/src/common/iso_8601.h +++ b/src/common/iso_8601.h @@ -30,7 +30,7 @@ namespace ceph { // If a date is invalid, boost::none is returned. boost::optional from_iso_8601( - std::string_view s, const bool ws_terminates = true) noexcept; + std::string_view s, const bool ws_terminates = true); enum class iso_8601_format { Y, YM, YMD, YMDh, YMDhm, YMDhms, YMDhmsn