* tests/unistr/test-chr.h (main): Redo types to pacify
gcc -Wcast-align.
---
 ChangeLog               | 4 ++++
 tests/unistr/test-chr.h | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8af3088936..67ab92d10a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-10-24  Paul Eggert  <egg...@cs.ucla.edu>
 
+       tests/unistr/u16-chr-tests: pacify -Wcast-align
+       * tests/unistr/test-chr.h (main): Redo types to pacify
+       gcc -Wcast-align.
+
        isnanl-tests, stdio-tests: pacify GCC -Wshadow
        * tests/test-isnanl.h (NWORDS): Remove.
        (memory_long_double): Do not redefine in an inner scope.
diff --git a/tests/unistr/test-chr.h b/tests/unistr/test-chr.h
index 7ee5dd2f84..228c7e6e9d 100644
--- a/tests/unistr/test-chr.h
+++ b/tests/unistr/test-chr.h
@@ -109,14 +109,14 @@ main (void)
   /* Check that uN_chr() does not read past the first occurrence of the
      byte being searched.  */
   {
-    char *page_boundary = (char *) zerosize_ptr ();
+    UNIT *page_boundary = zerosize_ptr ();
     size_t n;
 
     if (page_boundary != NULL)
       {
         for (n = 1; n <= 500 / sizeof (UNIT); n++)
           {
-            UNIT *mem = (UNIT *) (page_boundary - n * sizeof (UNIT));
+            UNIT *mem = page_boundary - n;
             U_SET (mem, 'X', n);
             ASSERT (U_CHR (mem, n, 'U') == NULL);
 
-- 
2.41.0


Reply via email to