bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hamt tests: Fix compilation error with AIX xlc


From: Bruno Haible
Subject: hamt tests: Fix compilation error with AIX xlc
Date: Fri, 24 Dec 2021 19:31:52 +0100

Compiling a testdir on AIX 7.1 with xlc, I get this compilation error:

source='test-hamt.c' object='test-hamt.o' libtool=no  DEPDIR=.deps depmode=xlc 
/bin/sh ../build-aux/depcomp  xlc -q64 -qthreaded -qtls -DHAVE_CONFIG_H 
-DEXEEXT=\"\" -I. -I..  -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. 
-I.  -I.. -I./..  -I../gllib -I./../gllib  -I/home/haible/prefix64/include 
-D_THREAD_SAFE  -g -c -o test-hamt.o test-hamt.c
"test-hamt.c", line 351.43: 1506-196 (S) Initialization between types "struct 
hamt*" and "struct hamt_iterator" is not allowed.
make: 1254-004 The error code from the last command is 1.

This patch fixes it.


2021-12-24  Bruno Haible  <bruno@clisp.org>

        hamt tests: Fix compilation error with AIX xlc.
        * tests/test-hamt.c (test_iterator): Don't use compound initializer.

diff --git a/tests/test-hamt.c b/tests/test-hamt.c
index 882bf0fc7..5b953741c 100644
--- a/tests/test-hamt.c
+++ b/tests/test-hamt.c
@@ -348,7 +348,8 @@ test_iterator (void)
 {
   Hamt *hamt = test_hamt_create ();
   ASSERT (insert_values (&hamt, 10, val_array1, true) == 10);
-  Hamt_iterator iter [1] = {hamt_iterator (hamt)};
+  Hamt_iterator iter[1];
+  iter[0] = hamt_iterator (hamt);
   size_t cnt = 0;
   bool found [10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
   Hamt_entry *p;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]