Remove all remaining support for BSD/OS, IRIX, {OSF/1, Digital Unix,
Tru64 Unix}, SINIX and Ultrix.
Fix compiling on GNU/Hurd.
+ Make illumos build warning-free.
DayOfTheWeek, Month DD, YYYY / The Tcpdump Group
Summary for 4.99.5 tcpdump release (so far!)
# later warnings in the same matrix subset trigger an error.
case `cc_id`/`os_id` in
-clang-*/SunOS-5.11)
- # (Clang 9 on OpenIndiana, Clang 11 on OmniOS)
- # tcpdump.c:2312:51: warning: this function declaration is not a prototype
- # [-Wstrict-prototypes]
- # tcpdump.c:2737:11: warning: this function declaration is not a prototype
- # [-Wstrict-prototypes]
- [ "`uname -o`" = illumos ] && TCPDUMP_TAINTED=yes
+*)
;;
esac
#define DIAG_ON_C11_EXTENSIONS \
DIAG_DO_PRAGMA(clang diagnostic pop)
#endif
+
+ /*
+ * When Clang correctly detects an old-style function prototype after
+ * preprocessing, the warning can be irrelevant to this source tree because
+ * the prototype comes from a system header macro.
+ */
+ #if ND_IS_AT_LEAST_CLANG_VERSION(5,0)
+ #define DIAG_OFF_STRICT_PROTOTYPES \
+ DIAG_DO_PRAGMA(clang diagnostic push) \
+ DIAG_DO_PRAGMA(clang diagnostic ignored "-Wstrict-prototypes")
+ #define DIAG_ON_STRICT_PROTOTYPES \
+ DIAG_DO_PRAGMA(clang diagnostic pop)
+ #endif
#elif ND_IS_AT_LEAST_GNUC_VERSION(4,2)
/* GCC apparently doesn't complain about ORing enums together. */
/*
* GCC supports -Wc99-c11-compat since version 5.1.0, but the warning does
* not trigger for now, so let's just leave it be.
+ *
+ * GCC does not currently generate any -Wstrict-prototypes warnings that
+ * would need silencing as is done for Clang above.
*/
#endif
#ifndef DIAG_ON_C11_EXTENSIONS
#define DIAG_ON_C11_EXTENSIONS
#endif
+#ifndef DIAG_OFF_STRICT_PROTOTYPES
+#define DIAG_OFF_STRICT_PROTOTYPES
+#endif
+#ifndef DIAG_ON_STRICT_PROTOTYPES
+#define DIAG_ON_STRICT_PROTOTYPES
+#endif
#ifndef ND_UNREACHABLE
#define ND_UNREACHABLE
#endif
#endif
/* Cooperate with nohup(1) */
#ifndef _WIN32
+ /*
+ * In illumos /usr/include/sys/iso/signal_iso.h causes Clang to
+ * generate a -Wstrict-prototypes warning here, see [1]. The
+ * __illumos__ macro is available since at least GCC 11 and Clang 13,
+ * see [2].
+ * 1: https://www.illumos.org/issues/16344
+ * 2: https://www.illumos.org/issues/13726
+ */
+#ifdef __illumos__
+ DIAG_OFF_STRICT_PROTOTYPES
+#endif /* __illumos__ */
if ((oldhandler = setsignal(SIGHUP, cleanup)) != SIG_DFL)
+#ifdef __illumos__
+ DIAG_ON_STRICT_PROTOTYPES
+#endif /* __illumos__ */
(void)setsignal(SIGHUP, oldhandler);
#endif /* _WIN32 */
)
new.sa_flags = SA_RESTART;
if (sigaction(sig, &new, &old) < 0)
+ /* The same workaround as for SIG_DFL above. */
+#ifdef __illumos__
+ DIAG_OFF_STRICT_PROTOTYPES
+#endif /* __illumos__ */
return (SIG_ERR);
+#ifdef __illumos__
+ DIAG_ON_STRICT_PROTOTYPES
+#endif /* __illumos__ */
return (old.sa_handler);
#endif
}