rcx

library of miscellaneous bits of C code
git clone git://git.rr3.xyz/rcx
Log | Files | Refs | README | LICENSE

commit c311c6c12c8e0f7386520f2e2d3a96013f6ba31b
parent b893f8927db48af928fead395ecb6f6935faa7df
Author: Robert Russell <robertrussell.72001@gmail.com>
Date:   Thu, 23 Feb 2023 23:47:16 -0800

Use new assert

It turns out that empty argument lists for variadic macros is not allowed
in standard C, so we remove -pedantic to not get any warnings. Sigh...

Diffstat:
MMakefile | 6+++---
Mconfig.mk | 2+-
Msrc/str.c | 4++--
Msrc/unix.c | 2+-
Mtool/ucattab.c | 2+-
5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile @@ -28,9 +28,9 @@ src/debug.o: src/debug.c inc/debug.h inc/def.h inc/rcx.h config.mk src/error.o: src/error.c inc/def.h inc/error.h inc/log.h inc/rcx.h config.mk src/log.o: src/log.c inc/def.h inc/log.h inc/rcx.h config.mk src/opt.o: src/opt.c inc/def.h inc/opt.h inc/rcx.h config.mk -src/str.o: src/str.c inc/alloc.h inc/def.h inc/log.h inc/rcx.h inc/str.h config.mk +src/str.o: src/str.c inc/alloc.h inc/debug.h inc/def.h inc/log.h inc/rcx.h inc/str.h config.mk src/unicode.o: src/unicode.c inc/def.h inc/rcx.h gen/ucattab.inc config.mk -src/unix.o: src/unix.c inc/def.h inc/rcx.h inc/unix.h config.mk +src/unix.o: src/unix.c inc/debug.h inc/def.h inc/rcx.h inc/unix.h config.mk src/utf8.o: src/utf8.c inc/def.h inc/rcx.h inc/utf8.h config.mk gen/ucattab.inc: gen tool/ucattab gen/UnicodeData.txt @@ -42,7 +42,7 @@ gen/UnicodeData.txt: gen gen: mkdir gen -tool/ucattab: tool/ucattab.c src/alloc.o src/log.o src/str.o +tool/ucattab: tool/ucattab.c src/alloc.o src/debug.o src/log.o src/str.o $(CC) -o $@ $(CFLAGS) $^ install: librcx.a uninstall diff --git a/config.mk b/config.mk @@ -2,7 +2,7 @@ PREFIX = /usr/local INCPREFIX = $(PREFIX)/include LIBPREFIX = $(PREFIX)/lib -CFLAGS = -std=c11 -O2 -Wall -pedantic -Iinc +CFLAGS = -std=c11 -O2 -Wall -Iinc CC = cc AR = ar diff --git a/src/str.c b/src/str.c @@ -1,10 +1,10 @@ #define _ISOC99_SOURCE /* vsnprintf */ -#include <assert.h> #include <errno.h> #include <stdio.h> #include <string.h> #include "alloc.h" +#include "debug.h" #include "log.h" #include "rcx.h" #include "str.h" @@ -110,7 +110,7 @@ r_str_count(char *s, char *sub) { usize r_str_split(char ***fields, char *s, char *sep, usize n) { - assert(strcmp(sep, "")); + assert(strcmp(sep, ""), "separator must be nonempty"); if (n == 0) { n = r_str_count(s, sep) + 1; diff --git a/src/unix.c b/src/unix.c @@ -1,9 +1,9 @@ -#include <assert.h> #include <errno.h> #include <string.h> #include <sys/uio.h> #include <unistd.h> +#include "debug.h" #include "rcx.h" #include "unix.h" diff --git a/tool/ucattab.c b/tool/ucattab.c @@ -1,10 +1,10 @@ -#include <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "alloc.h" +#include "debug.h" #include "rcx.h" #include "log.h" #include "str.h"