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 <ivan.boule@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
uint64_t s;
unsigned i, j;
const struct rte_memseg *mem;
- volatile uint8_t x;
/*
* dump the mapped memory: the python-expect script checks
/* check memory */
for (j = 0; j<mem[i].len; j++) {
- x = *((uint8_t *) mem[i].addr + j);
- RTE_SET_USED(x);
+ *((volatile uint8_t *) mem[i].addr + j);
}
}