GCC 4.1.0 vs 3.4.3 Compile Issue

Brian Dessent brian@dessent.net
Tue Jan 2 05:10:00 GMT 2007


John Doe wrote:

> typedef void* HANDLETYPE;
> 
> ERRORTYPE VIDDEC_HandleCommand (HANDLETYPE phandle, ...)
> {
> 
> VIDDEC_COMPONENT_PRIVATE* pComponentPrivate =
> (VIDDEC_COMPONENT_PRIVATE*)phandle;
> HANDLETYPE hIPC = NULL;
> ....
> ....
> (IPC_DSP_INTERFACE*)pComponentPrivate->pIPC = (IPC_DSP_INTERFACE*)hIPC;
> 
> The line immediately above this text is causing the aforementioned
> "invalid lvalue in assignment" error.  Would this qualify as one of
> the deprecated conditions you mentioned below?

Note that -> has a higher level of precedence than (cast) in the C
langauge, so if your intent here is to dereference pComponentPrivate as
a pointer to some type IPC_DSP_INTERFACE then you need parentheses.

Brian



More information about the Gcc-help mailing list