From 34e4d4287680271e8a1bdddb455fc539c18fd82b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 11 Jun 2025 07:21:21 +0100 Subject: [PATCH] Deal with errors generated when RELEASE build made --- Makefile | 2 +- base.h | 4 +++- lisp/context.c | 2 ++ main.c | 5 ++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 355f51c..dee6e04 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ DEPFLAGS=-MT $@ -MMD -MP -MF ifeq ($(RELEASE), 1) CFLAGS=$(GFLAGS) $(RFLAGS) -DDEBUG=0 else -CFLAGS=$(GFLAGS) $(DFLAGS) +CFLAGS=$(GFLAGS) $(DFLAGS) -DDEBUG=2 endif DIST=build diff --git a/base.h b/base.h index f841328..3273d97 100644 --- a/base.h +++ b/base.h @@ -45,7 +45,7 @@ static_assert(sizeof(f64) == sizeof(u64)); #define TODO(MSG) (assert(false && MSG)); #ifndef DEBUG -#define DEBUG 2 +#define DEBUG 0 #endif static inline void debug(char *fmt, ...) @@ -55,6 +55,8 @@ static inline void debug(char *fmt, ...) va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); +#else + (void)fmt; #endif } diff --git a/lisp/context.c b/lisp/context.c index 3b94e54..6d13a9f 100644 --- a/lisp/context.c +++ b/lisp/context.c @@ -88,5 +88,7 @@ void context_report(context_t *context) info(": %luB/%luB main memory used\n", mem_used, mem_cap); info(": %luB/%luB read space used\n", read_used, read_cap); info(": %luB/%luB scratch space used\n", scr_used, scr_cap); +#else + (void)context; #endif } diff --git a/main.c b/main.c index 3a1c2f2..96a15ab 100644 --- a/main.c +++ b/main.c @@ -88,10 +88,9 @@ int main(int argc, char *argv[]) u64 size = results.size / sizeof(*lisps); for (u64 i = 0; i < size; ++i) { - lisp_t *lisp = lisps[i]; - // printf("tag=%x\n", tag_get(lisp)); + lisp_t *lisp = lisps[i]; sv_t serialised = serialise(&ctx, lisp); - info("lisp[%lu]: %p => " PR_SV "\n", i, lisp, SV_FMT(serialised)); + debug("lisp[%lu]: %p => " PR_SV "\n", i, lisp, SV_FMT(serialised)); } context_report(&ctx);