* lvalue casting
@ 2005-09-30 0:31 Yuri Karlsbrun
2005-09-30 11:30 ` John Love-Jensen
0 siblings, 1 reply; 2+ messages in thread
From: Yuri Karlsbrun @ 2005-09-30 0:31 UTC (permalink / raw)
To: gcc-help
Hi,
I have legacy code using lvalue casting like this:
(unsigned long)a = b;
gcc-4.0.1 issues compilation error. Is there a compiler option to allow
this code?
Thanks,
Yuri Karlsbrun
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: lvalue casting
2005-09-30 0:31 lvalue casting Yuri Karlsbrun
@ 2005-09-30 11:30 ` John Love-Jensen
0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2005-09-30 11:30 UTC (permalink / raw)
To: Yuri Karlsbrun, MSX to GCC
Hi Yuri,
Maybe the -fnon-lvalue-assign flag will do what you need.
But I think you should change the code to be compliant.
(type)expr ---becomes---> *(type *)&expr
cond ? expr1 : expr2 ---becomes---> *(cond ? &expr1 : &expr2)
HTH,
--Eljay
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-30 11:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30 0:31 lvalue casting Yuri Karlsbrun
2005-09-30 11:30 ` John Love-Jensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).