From: Ivan Boule Date: Thu, 22 Sep 2011 16:01:35 +0000 (+0200) Subject: app: fix volatile read for GCC >= 4.6 X-Git-Tag: spdx-start~11275 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=85f5ae8b70062bef6e9289542879e007945a29f1;p=dpdk.git app: fix volatile read for GCC >= 4.6 When a memory address must be read, for instance a [mapped] PCI register, the read value is assigned to a local variable that is not used after, as for instance: x = *((uint8_t *) mem_addr); Such instructions do not compile with gcc 4.6. The fix consists in adding the "volatile" attribute to the accessed data type and to not assign the read value: *((volatile uint8_t *) mem_addr); Signed-off-by: Ivan Boule Acked-by: Olivier Matz --- diff --git a/app/test/test_memory.c b/app/test/test_memory.c index f9c70370b5..0dd09a620f 100644 --- a/app/test/test_memory.c +++ b/app/test/test_memory.c @@ -60,7 +60,6 @@ test_memory(void) uint64_t s; unsigned i, j; const struct rte_memseg *mem; - volatile uint8_t x; /* * dump the mapped memory: the python-expect script checks @@ -82,8 +81,7 @@ test_memory(void) /* check memory */ for (j = 0; j