From: Øyvind Harboe Date: Mon, 31 Oct 2011 21:03:49 +0000 (+0100) Subject: str9x: explain compiler that a local variable will always be initialized X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d931bb5a0513784300830c098a92fd683ad7c09c;p=fw%2Fopenocd str9x: explain compiler that a local variable will always be initialized Change-Id: I9ddb2793b4cdbf6acea6f69973531491e4ebcc5b Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/145 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c index 61a438fc9..63cfd18f7 100644 --- a/src/flash/nor/str9x.c +++ b/src/flash/nor/str9x.c @@ -280,6 +280,9 @@ static int str9x_erase(struct flash_bank *bank, int first, int last) total_timeout = 1000; } + /* this is so the compiler can *know* */ + assert(total_timeout > 0); + for (i = first; i <= last; i++) { int retval;