X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ca94c264bf987ff4ec7adffabca2a8d2e4e07efb..e6eab7bccfbf8fe9c386e16a9c5441e7a57066ae:/netdissect-stdinc.h diff --git a/netdissect-stdinc.h b/netdissect-stdinc.h index 7bea0c4f..8f1e5727 100644 --- a/netdissect-stdinc.h +++ b/netdissect-stdinc.h @@ -328,8 +328,8 @@ typedef char* caddr_t; * VS prior to 2015, or MingGW; assume we have _snprintf_s() and * _vsnprintf_s(), which guarantee null termination. */ - #define nd_snprintf(buf, buflen, fmt, ...) \ - _snprintf_s(buf, buflen, _TRUNCATE, fmt, __VA_ARGS__) + #define nd_snprintf(buf, buflen, ...) \ + _snprintf_s(buf, buflen, _TRUNCATE, __VA_ARGS__) #define nd_vsnprintf(buf, buflen, fmt, ap) \ _vsnprintf_s(buf, buflen, _TRUNCATE, fmt, ap) #endif /* defined(_MSC_VER) && _MSC_VER >= 1900 */ @@ -519,8 +519,16 @@ struct in6_addr { * it also implement __has_attribute() (for example, GCC 5.0 and later * have __has_attribute(), and the "fallthrough" attribute was introduced * in GCC 7). + * + * Unfortunately, Clang does this wrong - a statement + * + * __attribute__ ((fallthrough)); + * + * produces bogus -Wmissing-declaration "declaration does not declare + * anything" warnings (dear Clang: that's not a declaration, it's an + * empty statement). GCC, however, has no trouble with this. */ -#if __has_attribute(fallthrough) +#if __has_attribute(fallthrough) && !defined(__clang__) # define ND_FALL_THROUGH __attribute__ ((fallthrough)) #else # define ND_FALL_THROUGH