From: Brian Norris Date: Wed, 18 Feb 2015 02:18:36 +0000 (-0800) Subject: tools/thermal: tmon: silence 'set but not used' warnings X-Git-Tag: v4.0-rc2~3^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=986ffe0384c38606b94947fad04e5deacb515408;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git tools/thermal: tmon: silence 'set but not used' warnings gcc complains about the 'cols' variable being unused. This is unavoidable, given the ncurses getmaxyx() macro-based API, which wants to assign to a variable directly, even when we're not going to use it. Warning: gcc -O1 -Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int -fstack-protector -D VERSION=\"1.0\" -c -o tui.o tui.c tui.c: In function ‘show_dialogue’: tui.c:288:12: warning: variable ‘cols’ set but not used [-Wunused-but-set-variable] int rows, cols; ^ So, add a hack to get rid of that warning. Signed-off-by: Brian Norris Acked-by: Jacob Pan Reviewed-by: Florian Fainelli Signed-off-by: Zhang Rui --- diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c index 36e1f86..b5d1c6b 100644 --- a/tools/thermal/tmon/tui.c +++ b/tools/thermal/tmon/tui.c @@ -293,6 +293,9 @@ void show_dialogue(void) getmaxyx(w, rows, cols); + /* Silence compiler 'unused' warnings */ + (void)cols; + werase(w); box(w, 0, 0); mvwprintw(w, 0, maxx/4, DIAG_TITLE);