From c9f51acdc31a6277b9a743974fed06d390df221e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Fri, 21 Oct 2011 19:14:57 +0200 Subject: [PATCH] clang: fix warning w/assert so that clang knows that there will be no division by zero MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I98ac62a22f21043bb535a667a4f1f1537ccde2a4 Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/42 Tested-by: jenkins Reviewed-by: Øyvind Harboe --- src/target/target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/target/target.c b/src/target/target.c index b68eee36..d4cb577c 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3317,7 +3317,8 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, const char *filenam } } - int addressSpace = (max-min + 1); + int addressSpace = (max - min + 1); + assert(addressSpace >= 2); static const uint32_t maxBuckets = 16 * 1024; /* maximum buckets. */ uint32_t length = addressSpace; -- 2.39.5