[PATCH] tools: Fix bccmd build with GCC 4.9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure accessing array[63 * 2 + 4] is legal.

tools/bccmd.c: In function ‘cmd_buildname’:
tools/bccmd.c:406:18: error: iteration 63u invokes undefined behavior
     [-Werror=aggressive-loop-optimizations]
   name[i] = array[(i * 2) + 4];
---
 tools/bccmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bccmd.c b/tools/bccmd.c
index ff1b307..4649ad5 100644
--- a/tools/bccmd.c
+++ b/tools/bccmd.c
@@ -389,7 +389,7 @@ static int cmd_chiprev(int transport, int argc, char *argv[])
 
 static int cmd_buildname(int transport, int argc, char *argv[])
 {
-	uint8_t array[130];
+	uint8_t array[131];
 	char name[64];
 	unsigned int i;
 	int err;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux