Re: GCC 4.1.0 vs 3.4.3 Compile Issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Brian, Andrew,

Thanks so much for the help. The issue is now resolved after
implementing your suggested changes.  Apologies for asking for
assistance on such a basic question ... I was obviously able to get
away with this before (on 3.4.3), but I'm glad to see the newer
compilers are rejecting this now.

John Doe

On 1/2/07, Andrew Haley <aph@xxxxxxxxxxx> wrote:
John Doe writes:
 >
 > > without seeing the input that causes the error nobody will really
 > > be able to tell you much.
 >
 > Many thanks for the response.  I've pasted the relevant code below:
 >
 > 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?

This construct is known as an lvalue cast.  It used to be supported in
gcc, but isn't any longer.

It's easy enough to fix:

   pComponentPrivate->pIPC = (pIPCType*)hIPC;

Andrew.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux