]> The Tcpdump Group git mirrors - tcpdump/commit
Suppress UBSan warnings from EXTRACT_.
authorGuy Harris <[email protected]>
Sat, 19 Aug 2017 03:11:43 +0000 (20:11 -0700)
committerDenis Ovsienko <[email protected]>
Fri, 1 Sep 2017 21:20:16 +0000 (22:20 +0100)
commit6fc4beef8213322d50d6859d14d9dd71e3d613f4
tree334ef803670e9bee5f9e1c8544d5c708b037d270
parent17fd73dd233c92cdc0c48e56137b2f6db43f25d5
Suppress UBSan warnings from EXTRACT_.

Yes, the behavior of an access with an improperly-aligned pointer is
undefined according to the C standard, but if we're doing that in an
EXTRACT_ function/macro, we're doing it because we know it's safe and
because it's faster than picking the bytes out one by one and assembling
them, so suppress those warnings.

Pull over libpcap's funcattrs.h and use it to do a bunch of checks for
various function attributes; that defines __has_attribute(), so we can
use it to check for the "suppress sanitizer warnings" attribute.

While we're at it, use other things it defines to specify "this function
never returns", "this function is printf-like", and "this function
argument is a printf-style format argument", rather than using various
configure-script checks.  That should let us declare some function
attributes with Microsoft Visual Studio's compilers.
Makefile.in
extract.h
funcattrs.h [new file with mode: 0644]
netdissect-stdinc.h
netdissect.h
print.c
tcpdump.c