[Linux-ha-dev] cast lvalues is deprecated
alanr at unix.sh
Wed Jun 2 13:01:50 MDT 2004
Zhu, Yi wrote:
> I know here is not comp.lang.c, but may I have a question?
> I use gcc 3.3.3 within Fedora Core 2. I can't compile below
> code without warning any more. Any chance to fix it without strcpy?
> char * a; /* a must be char * */
> (const char *)a = "something";
This is illegal 'C'. The compiler is right to complain about it.
You need to fix the real problem.
You can try the code below, if someone else's software you have no control
over is broken...
I've had to do this in a place or two in the linux-ha...
char a = "something";
This should work for you...
char a is equivalent to char * a...
Alan Robertson <alanr at unix.sh>
"Openness is the foundation and preservative of friendship... Let me claim
from you at all times your undisguised opinions." - William Wilberforce
More information about the Linux-HA-Dev