From 85f5ae8b70062bef6e9289542879e007945a29f1 Mon Sep 17 00:00:00 2001 From: Ivan Boule Date: Thu, 22 Sep 2011 18:01:35 +0200 Subject: [PATCH] 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 --- app/test/test_memory.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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