From: Øyvind Harboe Date: Fri, 21 Oct 2011 17:14:57 +0000 (+0200) Subject: clang: fix warning w/assert so that clang knows that there will be no division by... X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c9f51acdc31a6277b9a743974fed06d390df221e;p=fw%2Fopenocd clang: fix warning w/assert so that clang knows that there will be no division by zero Change-Id: I98ac62a22f21043bb535a667a4f1f1537ccde2a4 Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/42 Tested-by: jenkins Reviewed-by: Øyvind Harboe --- diff --git a/src/target/target.c b/src/target/target.c index b68eee36a..d4cb577c4 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;