From: Guy Harris Date: Sat, 15 Sep 2018 21:18:40 +0000 (-0700) Subject: Squelch another warning. X-Git-Tag: libpcap-1.10-bp~797 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/3d1ad82ed8aa5e5ac762728343fc308a7e0c49b9?ds=sidebyside Squelch another warning. --- diff --git a/testprogs/valgrindtest.c b/testprogs/valgrindtest.c index ad293018..7d04a6f3 100644 --- a/testprogs/valgrindtest.c +++ b/testprogs/valgrindtest.c @@ -100,6 +100,21 @@ The Regents of the University of California. All rights reserved.\n"; #endif +/* + * Squelch a warning. + * + * We include system headers to be able to directly set the filter to + * a program with uninitialized content, to make sure what we're testing + * is Valgrind's checking of the system call to set the filter, and we + * also include to open the device in the first place, and that + * means that we may get collisions between their definitions of + * BPF_STMT - and do, in fact, get them on Linux (the definitons may be + * semantically the same, but that's not sufficient to avoid the warnings, + * as the preprocessor doesn't know that u_short is just unsigned short). + * + * So we undefine BPF_STMT to avoid the warning. + */ +#undef BPF_STMT #include static char *program_name;