From 5d6c06ab8095d8474efbf5743319a9db77639e9b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 30 Jun 2011 02:12:40 +0000 Subject: [PATCH] workaround new gcc-4.6 set-but-unused build warnings git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1926 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/tap/cable.c | 12 +++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 8441b3c2..e5294cc7 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,8 @@ +2011-06-29 Mike Frysinger + + * src/tap/cable.c (urj_tap_cable_wait): Tweak code style to silence warnings + thrown up by gcc-4.6 and cause build failures with -Werror. + 2011-06-27 Jie Zhang * include/urjtag/Makefile.am (nodist_pkginclude_HEADERS): New and diff --git a/urjtag/src/tap/cable.c b/urjtag/src/tap/cable.c index ea2e8c02..036113e6 100644 --- a/urjtag/src/tap/cable.c +++ b/urjtag/src/tap/cable.c @@ -522,15 +522,13 @@ urj_tap_cable_wait (urj_cable_t *cable) { int i; volatile int j; - uint32_t delay = cable->delay; - if (delay == 0) - return; - - for (i = 0; i < delay; ++i) - { + j = 0; + for (i = 0; i < cable->delay; ++i) j = i; - } + + /* Avoid gcc set-but-unused warnings */ + cable->delay = j; } static urj_cable_t *