path: root/cache.h
diff options
authorLinus Torvalds <>2005-06-06 17:12:31 (GMT)
committerLinus Torvalds <>2005-06-06 17:12:31 (GMT)
commit90334cf780428f1ca68e5f29fb543e3605fb2fc1 (patch)
treeff96101f1480b7a60bb863e95fbbe32bebabc66b /cache.h
parent64de356299c74d891de5c11385538b7bcbc15bae (diff)
Add "__noreturn__" attribute to die() and usage()
Only with gcc. It fixes some warnings for certain versions of gcc, but not apparently all.
Diffstat (limited to 'cache.h')
1 files changed, 8 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index aa901d1..95353a1 100644
--- a/cache.h
+++ b/cache.h
@@ -32,6 +32,12 @@
#define DTYPE(de) DT_UNKNOWN
+#ifdef __GNUC__
+#define NORETURN __attribute__((__noreturn__))
+#define NORETURN
* Environment variables transition.
* We accept older names for now but warn.
@@ -175,8 +181,8 @@ extern int get_sha1_hex(const char *hex, unsigned char *sha1);
extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
/* General helper functions */
-extern void usage(const char *err);
-extern void die(const char *err, ...);
+extern void usage(const char *err) NORETURN;
+extern void die(const char *err, ...) NORETURN;
extern int error(const char *err, ...);
extern int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);