aboutsummaryrefslogtreecommitdiff
path: root/lib.h
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2007-04-20 00:32:01 -0700
committerJosh Triplett <josh@freedesktop.org>2007-04-20 00:32:01 -0700
commit686c20f12cf85e4bc6c2356fba31cd105b754aa1 (patch)
treeb097f9382a52877dc7b48d395dada1bd33cbf3ab /lib.h
parentAdd test case for basic address_space annotations. (diff)
downloadsparse-686c20f12cf85e4bc6c2356fba31cd105b754aa1.tar.gz
sparse-686c20f12cf85e4bc6c2356fba31cd105b754aa1.tar.bz2
sparse-686c20f12cf85e4bc6c2356fba31cd105b754aa1.zip
Use noreturn on die() and error_die()
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib.h b/lib.h
index 472624d..97dee33 100644
--- a/lib.h
+++ b/lib.h
@@ -68,16 +68,18 @@ struct token *skip_to(struct token *, int);
struct token *expect(struct token *, int, const char *);
#ifdef __GNUC__
#define FORMAT_ATTR(pos) __attribute__ ((__format__ (__printf__, pos, pos+1)))
+#define NORETURN_ATTR __attribute__ ((__noreturn__))
#define SENTINEL_ATTR __attribute__ ((__sentinel__))
#else
#define FORMAT_ATTR(pos)
+#define NORETURN_ATTR
#define SENTINEL_ATTR
#endif
-extern void die(const char *, ...) FORMAT_ATTR(1);
+extern void die(const char *, ...) FORMAT_ATTR(1) NORETURN_ATTR;
extern void info(struct position, const char *, ...) FORMAT_ATTR(2);
extern void warning(struct position, const char *, ...) FORMAT_ATTR(2);
extern void sparse_error(struct position, const char *, ...) FORMAT_ATTR(2);
-extern void error_die(struct position, const char *, ...) FORMAT_ATTR(2);
+extern void error_die(struct position, const char *, ...) FORMAT_ATTR(2) NORETURN_ATTR;
extern void expression_error(struct expression *, const char *, ...) FORMAT_ATTR(2);
extern char **handle_switch(char *arg, char **next);