diff options
author | Derek Mauro <dmauro@google.com> | 2024-05-24 11:54:08 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-05-24 11:55:18 -0700 |
commit | 50d39219dc5a63f26d3871cfb3dbe198091eadad (patch) | |
tree | 48982c752c78a645cdf238cb00d47edf3b029cb7 | |
parent | 4a7c2ec65afca528226fd4a8fd514dda78572bda (diff) | |
download | abseil-50d39219dc5a63f26d3871cfb3dbe198091eadad.tar.gz abseil-50d39219dc5a63f26d3871cfb3dbe198091eadad.tar.bz2 abseil-50d39219dc5a63f26d3871cfb3dbe198091eadad.zip |
Silence a bogus GCC14 -Warray-bounds warning
PiperOrigin-RevId: 636990118
Change-Id: Ib90ed852b899a976679a8eb6352a9161c27e17ce
-rw-r--r-- | absl/strings/internal/charconv_bigint.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/absl/strings/internal/charconv_bigint.h b/absl/strings/internal/charconv_bigint.h index 5c0c375d..cb297676 100644 --- a/absl/strings/internal/charconv_bigint.h +++ b/absl/strings/internal/charconv_bigint.h @@ -109,7 +109,17 @@ class BigUnsigned { size_ = (std::min)(size_ + word_shift, max_words); count %= 32; if (count == 0) { +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=warray-bounds +// shows a lot of bogus -Warray-bounds warnings under GCC. +// This is not the only one in Abseil. +#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(14, 0) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif std::copy_backward(words_, words_ + size_ - word_shift, words_ + size_); +#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(14, 0) +#pragma GCC diagnostic pop +#endif } else { for (int i = (std::min)(size_, max_words - 1); i > word_shift; --i) { words_[i] = (words_[i - word_shift] << count) | |