From: Francois-Xavier Le Bail Date: Tue, 28 Apr 2015 04:17:16 +0000 (+0200) Subject: netdissect.h: Add a comment on IS_NOT_NEGATIVE macro X-Git-Tag: tcpdump-4.8.0~268 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/79bfaef492707e42eafa532625cb5f3698c3bba4 netdissect.h: Add a comment on IS_NOT_NEGATIVE macro --- diff --git a/netdissect.h b/netdissect.h index 9e369a99..0bf80c16 100644 --- a/netdissect.h +++ b/netdissect.h @@ -271,6 +271,11 @@ struct netdissect_options { * http://www.kb.cert.org/vuls/id/162289 */ +/* + * Test in two parts to avoid these warnings: + * comparison of unsigned expression >= 0 is always true [-Wtype-limits], + * comparison is always true due to limited range of data type [-Wtype-limits]. + */ #define IS_NOT_NEGATIVE(x) (((x) > 0) || ((x) == 0)) #define ND_TTEST2(var, l) \