From 7cffb54ce1a5956fdd41741a66de4026fe3ba2ac Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 14 Jan 2020 16:41:15 -0500 Subject: don't be different if NDEBUG is defined --- main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 5c60715..c04f168 100644 --- a/main.c +++ b/main.c @@ -1,9 +1,10 @@ #define _XOPEN_SOURCE 700 -#include #include #include #include #include +#include +#include #include #include "maje.h" @@ -37,8 +38,13 @@ static bool matches(const struct majefile * restrict file, const regex_t * restr char *find_main(struct majefile *sources) { regex_t re; - int rc = regcomp(&re, "int[[:space:]]+main[[:space:]\\(]", REG_EXTENDED | REG_NEWLINE | REG_NOSUB); - assert(rc == 0); + int rc = regcomp(&re, "int[[:space:]]+main[[:space:]\\(]", + REG_EXTENDED | REG_NEWLINE | REG_NOSUB); + if (rc != 0) { + fprintf(stderr, "maje: regcomp() failed\n"); + abort(); + } + char *ret = NULL; for (struct majefile *src = sources; src != NULL; src = src->next) { -- cgit v1.2.1