summaryrefslogtreecommitdiff
path: root/nasmlib.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-03-03 14:27:34 -0800
committerH. Peter Anvin <hpa@zytor.com>2016-03-03 15:22:02 -0800
commit41087068aa3d5ddac8b28cb2bdcacd606f475c08 (patch)
tree8462ec36489012084a0c6f8980f590be795f99e5 /nasmlib.c
parent7f087afc6633197416c036976858ef3565ed3cc8 (diff)
downloadnasm-41087068aa3d5ddac8b28cb2bdcacd606f475c08.tar.gz
Replace nasm_error(ERR_FATAL/ERR_PANIC) with nasm_fatal/nasm_panic
Replace all instances of ERR_FATAL or ERR_PANIC with nasm_fatal or nasm_panic so the compiler knows that these functions cannot return, *and* we trigger abort() if we were to ever violate that constraint. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'nasmlib.c')
-rw-r--r--nasmlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nasmlib.c b/nasmlib.c
index d19cbf6d..265091c7 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -163,7 +163,7 @@ char *nasm_strndup(const char *s, size_t len)
no_return nasm_assert_failed(const char *file, int line, const char *msg)
{
- nasm_error(ERR_FATAL, "assertion %s failed at %s:%d", msg, file, line);
+ nasm_fatal(0, "assertion %s failed at %s:%d", msg, file, line);
exit(1);
}
@@ -171,7 +171,7 @@ void nasm_write(const void *ptr, size_t size, FILE *f)
{
size_t n = fwrite(ptr, 1, size, f);
if (n != size)
- nasm_error(ERR_FATAL, "unable to write output: %s", strerror(errno));
+ nasm_fatal(0, "unable to write output: %s", strerror(errno));
}
#ifndef nasm_stricmp