#endif
#endif
+/*
+ * GCC needs this on AIX for longjmp().
+ */
+#if PCAP_IS_AT_LEAST_GNUC_VERSION(5,1)
+ /*
+ * Beware that the effect of this builtin is more than just squelching the
+ * warning! GCC trusts it enough for the process to segfault if the control
+ * flow reaches the builtin (an infinite empty loop in the same context would
+ * squelch the warning and ruin the process too, albeit in a different way).
+ * So please remember to use this very carefully.
+ */
+ #define PCAP_UNREACHABLE __builtin_unreachable();
+#else
+ #define PCAP_UNREACHABLE
+#endif
+
#endif /* _diag_control_h */
#include "pcap/sll.h"
#include "pcap/ipnet.h"
#include "arcnet.h"
+#include "diag-control.h"
#include "grammar.h"
#include "scanner.h"
longjmp(cstate->top_ctx, 1);
/*NOTREACHED*/
#ifdef _AIX
- /*
- * Same GCC workaround as in tcpdump.
- */
- while (1);
+ PCAP_UNREACHABLE
#endif /* _AIX */
}
#include "gencode.h"
#include "optimize.h"
+#include "diag-control.h"
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
longjmp(opt_state->top_ctx, 1);
/* NOTREACHED */
#ifdef _AIX
- /*
- * Same GCC workaround as in tcpdump.
- */
- while (1);
+ PCAP_UNREACHABLE
#endif /* _AIX */
}
longjmp(conv_state->top_ctx, 1);
/* NOTREACHED */
#ifdef _AIX
- /*
- * Same GCC workaround as in tcpdump.
- */
- while (1);
+ PCAP_UNREACHABLE
#endif /* _AIX */
}