From 1c5846378bf832562b7cc2eb782a743ec9cd32f5 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 24 Dec 2022 03:23:09 +0100 Subject: Compile examples with warnings --- examples/Makefile | 4 ++-- examples/gehashmap.c | 10 +++++----- examples/gevector.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/Makefile b/examples/Makefile index af41d5d..c6c5643 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,7 +1,8 @@ .POSIX: CC = cc -CFLAGS = -Og -g -ggdb +CFLAGS = -Wall -Wextra -Wpedantic -Werror \ + -Og -g -ggdb LDFLAGS = -I../src progs = gehashmap gevector @@ -9,7 +10,6 @@ progs = gehashmap gevector all: ${progs} gehashmap: gehashmap.c - gevector: gevector.c clean: diff --git a/examples/gehashmap.c b/examples/gehashmap.c index df91669..7d6d1a4 100644 --- a/examples/gehashmap.c +++ b/examples/gehashmap.c @@ -4,10 +4,10 @@ #include -GEHASHMAP_API(char *, int, atoimap); -GEHASHMAP_API(int, unsigned int, itoumap); -GEHASHMAP_IMPL(char *, int, atoimap); -GEHASHMAP_IMPL(int, unsigned int, itoumap); +GEHASHMAP_API(char *, int, atoimap) +GEHASHMAP_API(int, unsigned int, itoumap) +GEHASHMAP_IMPL(char *, int, atoimap) +GEHASHMAP_IMPL(int, unsigned int, itoumap) bool atoimap_key_iseq(char *a, char *b) @@ -39,7 +39,7 @@ atoimap_key_hash(char *s) char c; size_t x = 5381; - while (c = *s++) + while ((c = *s++)) x = ((x << 5) + x) + c; return x; diff --git a/examples/gevector.c b/examples/gevector.c index e554005..15adbad 100644 --- a/examples/gevector.c +++ b/examples/gevector.c @@ -3,8 +3,8 @@ #include -GEVECTOR_API(int, ivec); -GEVECTOR_IMPL(int, ivec); +GEVECTOR_API(int, ivec) +GEVECTOR_IMPL(int, ivec) int main(void) -- cgit v1.2.3