]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/fns.c (hash_string): Suppress warning on 32-bit platforms
authorMattias EngdegÄrd <mattiase@acm.org>
Thu, 22 Feb 2024 19:15:33 +0000 (20:15 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 28 Feb 2024 17:40:24 +0000 (18:40 +0100)
Remove a shift-too-wide complaint by GCC in code that is never reached
on platforms where that shift is too wide.

(cherry picked from commit 53e60fb004c0e8b40b01fcfcf7f406557e35aa3e)

src/fns.c

index 0a9692f36e82da3e3e5ed84372b87911b2f28ff1..737757d06ccc69ae52e0b438d87ce39693f6e482 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -5086,6 +5086,8 @@ hash_string (char const *ptr, ptrdiff_t len)
       /* String is shorter than an EMACS_UINT.  Use smaller loads.  */
       eassume (p <= end && end - p < sizeof (EMACS_UINT));
       EMACS_UINT tail = 0;
+      verify (sizeof tail <= 8);
+#if EMACS_INT_MAX > INT32_MAX
       if (end - p >= 4)
        {
          uint32_t c;
@@ -5093,6 +5095,7 @@ hash_string (char const *ptr, ptrdiff_t len)
          tail = (tail << (8 * sizeof c)) + c;
          p += sizeof c;
        }
+#endif
       if (end - p >= 2)
        {
          uint16_t c;