From 4f4aa0166a41939b1fa59d67925873df5aded4d8 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 5 Mar 2024 07:05:37 +0300 Subject: [PATCH 1/3] gh-108562: turn off false-positive -Wstringop-overflow in word_to_string() --- Misc/sbom.spdx.json | 4 ++-- Modules/_decimal/libmpdec/io.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Misc/sbom.spdx.json b/Misc/sbom.spdx.json index 7e9aa6dd82e619..af82377cf56bfa 100644 --- a/Misc/sbom.spdx.json +++ b/Misc/sbom.spdx.json @@ -1224,11 +1224,11 @@ "checksums": [ { "algorithm": "SHA1", - "checksumValue": "9dcb50e3f9c3245972731be5da0b28e7583198d9" + "checksumValue": "5d6fdd98730584f74f7b731da6e488fe234504b3" }, { "algorithm": "SHA256", - "checksumValue": "7cac49fef5e9d952ec9390bf81c54d83f1b5da32fdf76091c2f0770ed943b7fe" + "checksumValue": "d74f365463166891f62e1326d22b2d39d865776b7ea5e0df2aea5eede4d85b0f" } ], "fileName": "Modules/_decimal/libmpdec/io.c" diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c index 4e95b8964c8e5d..bdcca001659bc0 100644 --- a/Modules/_decimal/libmpdec/io.c +++ b/Modules/_decimal/libmpdec/io.c @@ -347,6 +347,10 @@ mpd_qset_string_exact(mpd_t *dec, const char *s, uint32_t *status) or the location of a decimal point. */ #define EXTRACT_DIGIT(s, x, d, dot) \ if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 12 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif static inline char * word_to_string(char *s, mpd_uint_t x, int n, char *dot) { @@ -378,6 +382,9 @@ word_to_string(char *s, mpd_uint_t x, int n, char *dot) *s = '\0'; return s; } +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 12 + #pragma GCC diagnostic pop +#endif /* Print exponent x to string s. Undefined for MPD_SSIZE_MIN. */ static inline char * From 503cd4320b82c1e1d7a254a6dffac4b96ae48376 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 5 Mar 2024 16:12:09 +0300 Subject: [PATCH 2/3] Add news --- .../next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst diff --git a/Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst b/Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst new file mode 100644 index 00000000000000..205ff3a195b94a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst @@ -0,0 +1 @@ +Filter out gcc warning in libmpdec/io.c. From 84136ecbaa920a8673ef9b10f40280b369089619 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 30 Jan 2025 13:32:37 +0300 Subject: [PATCH 3/3] drop news --- .../next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst diff --git a/Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst b/Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst deleted file mode 100644 index 205ff3a195b94a..00000000000000 --- a/Misc/NEWS.d/next/Library/2024-03-05-16-12-06.gh-issue-108562.4gGBpQ.rst +++ /dev/null @@ -1 +0,0 @@ -Filter out gcc warning in libmpdec/io.c.