]> The Tcpdump Group git mirrors - libpcap/commit
Address CLang "undefined defined" warnings. 653/head
authorDenis Ovsienko <[email protected]>
Sun, 15 Oct 2017 00:43:26 +0000 (00:43 +0000)
committerDenis Ovsienko <[email protected]>
Sun, 15 Oct 2017 00:43:26 +0000 (00:43 +0000)
commitf1f1c08af656c118cbcf99a40d868b757044ead5
tree46ebe5be45e93be2e47a4a78c5df6493cabd5cc6
parentc896b8a33427a00c28d78b48887898406d307de7
Address CLang "undefined defined" warnings.

Building tcpdump with CLang recently started to produce 9 warnings per
each .c file along the following lines:

In file included from ./print-pflog.c:39:
In file included from ./netdissect.h:75:
In file included from ../libpcap/pcap.h:43:
In file included from ../libpcap/pcap/pcap.h:72:
../libpcap/pcap/funcattrs.h:115:8: warning: macro expansion producing
'defined' has undefined behavior [-Wexpansion-to-defined]
    || PCAP_IS_AT_LEAST_SUNC_VERSION(5, 9) \
       ^
../libpcap/pcap/compiler-tests.h:89:3: note: expanded from macro
'PCAP_IS_AT_LEAST_SUNC_VERSION'
        (defined(__SUNPRO_C) && \
         ^

Replace each involved 2-ary macro with one or more 0-ary macro(s) and
use those. This will require to add a new 0-ary macro for each new
required combination of major/minor version numbers of a particular
compiler, but this change makes tcpdump compile almost cleanly again.
optimize.c
pcap/compiler-tests.h
pcap/funcattrs.h