ref: 82de71645422602820dca043f6abf604c8ec8411
parent: 25efb00769cb1a16fe3ab643e4b63d33402a5bcc
author: Anthony J. Bentley <[email protected]>
date: Tue Nov 4 12:28:30 EST 2014
Mark error functions as _Noreturn.
--- a/Makefile
+++ b/Makefile
@@ -93,7 +93,8 @@
mingw:
$Qenv PATH=/usr/local/mingw32/bin:/bin:/usr/bin:/usr/local/bin \
make CC=gcc CFLAGS="-I/usr/local/mingw32/include \
- -D__progname=\\\"\\\" ${CFLAGS}"
+ -D__progname=\\\"\\\" \
+ -D_Noreturn='__attribute__((noreturn))' ${CFLAGS}"
$Qmv rgbasm rgbasm.exe
$Qmv rgblink rgblink.exe
$Qmv rgbfix rgbfix.exe
--- a/src/extern/err.c
+++ b/src/extern/err.c
@@ -47,13 +47,13 @@
putc('\n', stderr);
}
-void rgbds_verr(int status, const char *fmt, va_list ap)
+_Noreturn void rgbds_verr(int status, const char *fmt, va_list ap)
{
vwarn(fmt, ap);
exit(status);
}
-void rgbds_verrx(int status, const char *fmt, va_list ap)
+_Noreturn void rgbds_verrx(int status, const char *fmt, va_list ap)
{
vwarnx(fmt, ap);
exit(status);
@@ -75,7 +75,7 @@
va_end(ap);
}
-void rgbds_err(int status, const char *fmt, ...)
+_Noreturn void rgbds_err(int status, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -83,7 +83,7 @@
va_end(ap);
}
-void rgbds_errx(int status, const char *fmt, ...)
+_Noreturn void rgbds_errx(int status, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);