[Linux-ha-dev] cast lvalues is deprecated
alanr at unix.sh
Wed Jun 2 16:08:14 MDT 2004
Lars Ellenberg wrote:
> / 2004-06-02 14:35:09 -0600
> \ Alan Robertson:
>>>> char a = "something";
>>>>This should work for you...
>>>> char a is equivalent to char * a...
>>>not exactly, because it places "something" in the local stack frame.
>>So? If it's a lifetime issue, then OK... But, you could also fix that by
>>prefixing it with static.
> sorry for the niticking...
> but since I suggested that already,
> and Yi already said it is ok for him,
> I thought I point out the difference.
> btw, I found that macro very usefull in many circumstances ...
Then I'm sure you won't mind if I nitpick back ;-)
As I'm sure you noted from the quoting, I hadn't read your post yet. But
if I had, I'd still have written what I did since what I wrote was simpler,
and reflects how the existing code already handles this situation.
As you noted, your macro is non-portable, which makes it less than ideal.
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