This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: ISO C++ forbids cast to non-reference type used as lvalue ?


On Mon, 11 Jul 2005, Daniel Kegel wrote:

> Steven Scholz wrote:
> > Hi,
> >
> > I upgraded my toolchain to gcc-3.4.4-glibc-2.3.5-linux-2.6.12 yesterday.
> >
> > Now while compiling my c++ application I get
> >
> >     ISO C++ forbids cast to non-reference type used as lvalue
> >
> > for lines like
> >
> >     (DWORD *) pbData += 1;
> >
> > How could I workaround that, i.e. is there a flag to shut up the compiler?
>
> No.  Fix your code.  Sorry.  Yes, it's painful.

i ran into precisely this problem trying to compile "openembedded"
with gcc4, and found out that the module utils code uses that lvalue
casting in places, which means you can't compile openembedded with
gcc4.  drat.

obviously, one can clean up one's *own* code, but it's more
troublesome when kernel and kernel-related code uses that now-illegal
construct.

rday

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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