Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jul 2015 21:32:58 +0000 (UTC)
From:      Patrick Kelsey <pkelsey@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r285292 - vendor/tcpdump/dist
Message-ID:  <201507082132.t68LWwhs060950@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkelsey
Date: Wed Jul  8 21:32:57 2015
New Revision: 285292
URL: https://svnweb.freebsd.org/changeset/base/285292

Log:
  Merge upstream fix to eliminate build-breaking gcc warnings of no
  importance.
  
  commit: cab33b7a0acba7d2268a23c4383be6167106e549
  
  Update ND_TTEST2 to fix issue 443
  
  Add IS_NOT_NEGATIVE macro.
  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].
  
  Approved by: jmallett (mentor)

Modified:
  vendor/tcpdump/dist/netdissect.h

Modified: vendor/tcpdump/dist/netdissect.h
==============================================================================
--- vendor/tcpdump/dist/netdissect.h	Wed Jul  8 21:06:19 2015	(r285291)
+++ vendor/tcpdump/dist/netdissect.h	Wed Jul  8 21:32:57 2015	(r285292)
@@ -270,8 +270,11 @@ struct netdissect_options {
  *
  *	http://www.kb.cert.org/vuls/id/162289
  */
+
+#define IS_NOT_NEGATIVE(x) (((x) > 0) || ((x) == 0))
+
 #define ND_TTEST2(var, l) \
-  ((l) >= 0 && \
+  (IS_NOT_NEGATIVE(l) && \
 	((uintptr_t)ndo->ndo_snapend - (l) <= (uintptr_t)ndo->ndo_snapend && \
          (uintptr_t)&(var) <= (uintptr_t)ndo->ndo_snapend - (l)))
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507082132.t68LWwhs060950>