Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-129467: turn off false-positive -Wstringop-overflow in word_to_string() #116346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Misc/sbom.spdx.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Modules/_decimal/libmpdec/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 *
Expand Down
Loading