Only use GCC-specific __dead2 marker when building with GCC.

This commit is contained in:
Tim Kientzle 2008-12-06 07:37:14 +00:00
parent 4b058a88d8
commit d47cf339f4
2 changed files with 11 additions and 1 deletions

View File

@ -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 *);

View File

@ -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 */