summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-12-06 07:37:14 +0000
committerkientzle <kientzle@FreeBSD.org>2008-12-06 07:37:14 +0000
commit48226e3cb7a05c55df4621d0a902df76309cf0cc (patch)
treea7b1975f8be238d8c854e9891c6bad10ef386959 /usr.bin/tar
parent220fc96fced98c00b4ba7226c6a8f17e7850ffbe (diff)
downloadFreeBSD-src-48226e3cb7a05c55df4621d0a902df76309cf0cc.zip
FreeBSD-src-48226e3cb7a05c55df4621d0a902df76309cf0cc.tar.gz
Only use GCC-specific __dead2 marker when building with GCC.
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/bsdtar.h2
-rw-r--r--usr.bin/tar/bsdtar_platform.h10
2 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/tar/bsdtar.h b/usr.bin/tar/bsdtar.h
index 3a4f549..3b4edae 100644
--- a/usr.bin/tar/bsdtar.h
+++ b/usr.bin/tar/bsdtar.h
@@ -131,7 +131,7 @@ enum {
void bsdtar_errc(struct bsdtar *, int _eval, int _code,
- const char *fmt, ...) __dead2;
+ const char *fmt, ...) __LA_DEAD;
int bsdtar_getopt(struct bsdtar *);
void bsdtar_warnc(struct bsdtar *, int _code, const char *fmt, ...);
void cleanup_exclusions(struct bsdtar *);
diff --git a/usr.bin/tar/bsdtar_platform.h b/usr.bin/tar/bsdtar_platform.h
index 52d160e..7cc684d 100644
--- a/usr.bin/tar/bsdtar_platform.h
+++ b/usr.bin/tar/bsdtar_platform.h
@@ -147,4 +147,14 @@
#endif
#endif
+/* How to mark functions that don't return. */
+/* This facilitates use of some newer static code analysis tools. */
+#undef __LA_DEAD
+#if defined(__GNUC__) && (__GNUC__ > 2 || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_DEAD __attribute__((__noreturn__))
+#else
+#define __LA_DEAD
+#endif
+
#endif /* !BSDTAR_PLATFORM_H_INCLUDED */
OpenPOWER on IntegriCloud