From da191ee1acc13c2428ecedfaee2340e2dc68d756 Mon Sep 17 00:00:00 2001 From: Anatol Pomozov Date: Sat, 5 Mar 2016 20:47:08 -0800 Subject: [PATCH] iteflash: Initialize variable that later used in the function Latest GCC gives compiler error: util/iteflash.c: In function verify_flash: util/iteflash.c:927:9: error: res may be used uninitialized in this function [-Werror=maybe-uninitialized] return res; ^ BUG=None TEST=`make buildall -j` outside chroot BRANCH=None Change-Id: I184d8673020552797fd54bb98ee582a63debbf16 Signed-off-by: Anatol Pomozov Reviewed-on: https://chromium-review.googlesource.com/330873 Reviewed-by: Shawn N --- util/iteflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/iteflash.c b/util/iteflash.c index 62bf8b8de2..3a0e2257da 100644 --- a/util/iteflash.c +++ b/util/iteflash.c @@ -885,7 +885,7 @@ int write_flash(struct ftdi_context *ftdi, const char *filename, int verify_flash(struct ftdi_context *ftdi, const char *filename, uint32_t offset) { - int res; + int res = 0; int file_size; FILE *hnd; uint8_t *buffer = malloc(flash_size);