From 5a5fee867a2427b35bf6acec3e176e768cb5b7d2 Mon Sep 17 00:00:00 2001 From: mingodad Date: Sun, 30 Mar 2014 10:10:24 +0100 Subject: [PATCH] Add __attribute__ ((noreturn)) to tcc_error and expect functions. This make use of static analysis tools like scan-build report less false positives. --- tcc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcc.h b/tcc.h index f89b146a..5ab50d67 100644 --- a/tcc.h +++ b/tcc.h @@ -1045,7 +1045,7 @@ PUB_FUNC char *tcc_strdup(const char *str); #define strdup(s) use_tcc_strdup(s) PUB_FUNC void tcc_memstats(void); PUB_FUNC void tcc_error_noabort(const char *fmt, ...); -PUB_FUNC void tcc_error(const char *fmt, ...); +PUB_FUNC void tcc_error(const char *fmt, ...) __attribute__ ((noreturn)); PUB_FUNC void tcc_warning(const char *fmt, ...); /* other utilities */ @@ -1143,7 +1143,7 @@ ST_FUNC void preprocess_init(TCCState *s1); ST_FUNC void preprocess_new(void); ST_FUNC int tcc_preprocess(TCCState *s1); ST_FUNC void skip(int c); -ST_FUNC void expect(const char *msg); +ST_FUNC void expect(const char *msg) __attribute__ ((noreturn)); /* ------------ tccgen.c ------------ */