summaryrefslogtreecommitdiff
path: root/funcattrs.h
Commit message (Collapse)AuthorAgeFilesLines
* MSVC doesn't allow __declspec(noreturn) to be applied to function pointers.Guy Harris2017-09-061-1/+3
|
* Sun C/Oracle Studio doesn't let you declare a function pointer "noreturn", ↵Guy Harris2017-08-191-1/+4
| | | | either.
* Handle attributes for function pointers by checking the compiler version.Guy Harris2017-08-191-0/+23
| | | | | | | | | | | Handle attributes for function pointers the same way we handle attributes for functions, by explicitly checking for the compiler version with #if rather than with a configure script check. That's one fewer thing that, if you're not using autoconf, has to be done in some other fashion. While we're at it, put NORETURN in the right place to have it work with Microsoft Visual Studio as well as various UN*X compilers.
* Suppress UBSan warnings from EXTRACT_.Guy Harris2017-08-181-0/+122
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.