This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

oversensitive "use of cast expressions as lvalues is deprecated"


The following statement is the result of a macro expansion 
(hence all the extra parenthesis). gcc's giving me a new 
warning about using a casted lvalue. I don't see where there is 
a casted lvalue here. The rhs of the assigment is an rvalue, so 
I'll ignore that. port is casted, but it's an rvalue at this 
point. Once it's dereferenced it's an lvalue, but there's no 
further casting after that. What's gone wrong here?

int port;
const void* src;
(*((volatile uint16_t*)(port)) = (*((uint16_t *) src)++));

../../arch-at91/arch.c: In function `outportsw':
../../arch-at91/arch.c:79: warning: use of cast expressions as 
lvalues is deprecated

Cheers,
Shaun


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]