From 39d164f5a8835730fa336eb712f1ab08a3e96bd5 Mon Sep 17 00:00:00 2001 From: Stefan Meinecke Date: Sun, 18 Oct 2026 02:15:07 +0200 Subject: [PATCH] hashtest: fix build so the suite actually runs htest.c was missing the "typedef struct hash hash" that hash.h requires, and the Makefile linked the top-level ../hash.o which is built without -DHASH_DEBUG, leaving hash_dump/hash_item_print undefined. Build a local hash.o with the flag instead. All 16 tests now compile and pass. --- hashtest/Makefile | 5 ++++- hashtest/htest.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hashtest/Makefile b/hashtest/Makefile index 168319c..edf01cb 100644 --- a/hashtest/Makefile +++ b/hashtest/Makefile @@ -1,6 +1,9 @@ CFLAGS=-DHASH_DEBUG -O2 -Wall -OBJ=../hash.o ../gap.o htest.o +OBJ=hash.o ../gap.o htest.o + +hash.o: ../hash.c + $(CC) $(CFLAGS) -c -o $@ $< htest: $(OBJ) $(CC) -o htest $(OBJ) diff --git a/hashtest/htest.c b/hashtest/htest.c index 55c0cf9..fb83f4c 100644 --- a/hashtest/htest.c +++ b/hashtest/htest.c @@ -29,6 +29,7 @@ struct hash_item { }; typedef struct hash_item* hash_item; +typedef struct hash hash; #include "../hash.h"