From 671cdad1c26a080541b96b5c10bb4a88d57bc3aa Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Sun, 23 Aug 2020 11:56:17 -0700 Subject: [PATCH 1/3] Add pedantic to default warnings --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 20fbe49..b423b4e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ CC=gcc -CFLAGS+=-Wall -std=gnu99 -no-pie +CFLAGS+=-Wall -Wpedantic -std=gnu99 -no-pie version = $(shell git describe --always --tags --dirty) CFLAGS+="-DVERSION=\"$(version)\"" From 8bf5a832a9d8c4e467233cb8727a8f05fb95e6cb Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Sun, 23 Aug 2020 11:56:40 -0700 Subject: [PATCH 2/3] Remove non-ISO statement expressions for min/max macros --- src/util.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/util.h b/src/util.h index bc64d1e..76c7931 100644 --- a/src/util.h +++ b/src/util.h @@ -44,19 +44,8 @@ static inline void _log_unused(const int dummy, ...) { // min/max macros // from https://stackoverflow.com/questions/3437404/min-and-max-in-c -#define max(a, b) \ - ({ \ - __typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a > _b ? _a : _b; \ - }) - -#define min(a, b) \ - ({ \ - __typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a < _b ? _a : _b; \ - }) +#define max(a,b) ((a) > (b) ? (a) : (b)) +#define min(a,b) ((a) < (b) ? (a) : (b)) // ncurses-compatible CTRL+KEY definition // NOTE: c should be lowercase From 7a31b2d4868212996ba4c5fd1c945d93b31b9c32 Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Fri, 28 Aug 2020 17:41:45 -0700 Subject: [PATCH 3/3] Fix...argtable? --- src/lib/argtable3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/argtable3.c b/src/lib/argtable3.c index b95c1d7..36e8452 100644 --- a/src/lib/argtable3.c +++ b/src/lib/argtable3.c @@ -542,7 +542,7 @@ static unsigned int enhanced_hash(arg_hashtable_t* h, void* k) { static unsigned int index_for(unsigned int tablelength, unsigned int hashvalue) { return (hashvalue % tablelength); -}; +} arg_hashtable_t* arg_hashtable_create(unsigned int minsize, unsigned int (*hashfn)(void*), int (*eqfn)(void*, void*)) { arg_hashtable_t* h;