diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-12-02 10:26:09 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-12-02 10:56:41 -0500 |
commit | 5920a1b5e19e529ab3a3972348a6d53bcd90acfc (patch) | |
tree | c791c10af803beac372c4eef052eca8183410257 | |
parent | bdef1cd0bb00251bf92e6a545bb6e0f2dc2814a5 (diff) | |
download | bfs-5920a1b5e19e529ab3a3972348a6d53bcd90acfc.tar.xz |
Give messages to unconditional assertion failures
-rw-r--r-- | color.c | 2 | ||||
-rw-r--r-- | ctx.c | 2 | ||||
-rw-r--r-- | dstring.c | 2 | ||||
-rw-r--r-- | parse.c | 2 | ||||
-rw-r--r-- | stat.c | 4 |
5 files changed, 6 insertions, 6 deletions
@@ -1081,7 +1081,7 @@ static int cvbuff(CFILE *cfile, const char *format, va_list args) { return 0; invalid: - assert(false); + assert(!"Invalid format string"); errno = EINVAL; return -1; } @@ -50,7 +50,7 @@ const char *debug_flag_name(enum debug_flags flag) { break; } - assert(false); + assert(!"Unrecognized debug flag"); return "???"; } @@ -192,7 +192,7 @@ int dstrvcatf(char **str, const char *format, va_list args) { tail = *str + len; ret = vsnprintf(tail, tail_len + 1, format, copy); if (ret < 0 || (size_t)ret != tail_len) { - assert(false); + assert(!"Length of formatted string changed"); goto fail; } } @@ -497,7 +497,7 @@ static const char *parse_int(const struct parser_state *state, const char *str, break; default: - assert(false); + assert(!"Invalid int size"); goto bad; } @@ -75,7 +75,7 @@ const char *bfs_stat_field_name(enum bfs_stat_field field) { return "modification time"; } - assert(false); + assert(!"Unrecognized stat field"); return "???"; } @@ -349,7 +349,7 @@ const struct timespec *bfs_stat_time(const struct bfs_stat *buf, enum bfs_stat_f case BFS_STAT_MTIME: return &buf->mtime; default: - assert(false); + assert(!"Invalid stat field for time"); errno = EINVAL; return NULL; } |