summaryrefslogtreecommitdiff
path: root/machdep.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-06-22 14:06:33 -0700
committerGuy Harris <guy@alum.mit.edu>2013-06-22 14:06:33 -0700
commit94bf5a24bf7c9c959ad90821655d2b68c92ef32f (patch)
treee5498e4298be3fe2083d3577b3baedee025a7d50 /machdep.c
parent85f8a9984983e54503c408166c78d256690dcd29 (diff)
downloadtcpdump-94bf5a24bf7c9c959ad90821655d2b68c92ef32f.tar.gz
Avoid some warnings from Sun C.
Some versions of Sun C support __attribute__ but don't support the "unused" or "format" attributes - they don't fail, but they whine a lot. They also support the "noreturn" attribute, but don't allow it to be applied to function pointers, only to functions. Check whether they can be used without warnings, and use them only if they can.
Diffstat (limited to 'machdep.c')
-rw-r--r--machdep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/machdep.c b/machdep.c
index 2bcf3174..6b3d473e 100644
--- a/machdep.c
+++ b/machdep.c
@@ -46,7 +46,10 @@ static const char rcsid[] _U_ =
#if !defined(HAVE_SNPRINTF)
int snprintf(char *, size_t, const char *, ...)
- __attribute__((format(printf, 3, 4)));
+#ifdef __ATTRIBUTE___FORMAT_OK
+ __attribute__((format(printf, 3, 4)))
+#endif /* __ATTRIBUTE___FORMAT_OK */
+ ;
#endif /* !defined(HAVE_SNPRINTF) */
#endif /* __osf__ */