Re: why is casting malloc a bad thing?
From: Sidney Cadot (sidney_at_jigsaw.nl)
Date: 01/30/04
- Next message: Amarendra GODBOLE: "Re: why is casting malloc a bad thing?"
- Previous message: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- In reply to: Dan Pop: "Re: why is casting malloc a bad thing?"
- Next in thread: Christian Bau: "Re: why is casting malloc a bad thing?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 18:52:32 +0100
Dan Pop wrote:
>> [...]
>>If you don't use the appropriate command line options to enable such
>>warnings, that's more of a problem than casting malloc results can ever be.
>>
>>In short, I think this argument is stale, and is getting staler all the
>>time.
> Try a reality check: how many newbies have you seen enabling such
> warnings when they show the way they compiled their code (quite often,
> people posting here show their compilation command line)?
All too many, for sure. I wouldn't necessarily recommend malloc casting
to newbies. I wouldn't recommend C to newbies, for that matter.
> And keep in mind that this discussion is focused on newbies, experienced
> programmers have already defined their preference pro or con casting
> void pointers and it is not this thread that is going to make them change
> their minds (you will keep casting when this discussion is over, I will
> keep avoiding such casts as the plague).
I agree on this for most part, except that this shows a level of
subtlety on this issue that does not rhyme well with the kind of
reactions that code samples with malloc casts invariably evokes
around here.
Best regards,
Sidney
- Next message: Amarendra GODBOLE: "Re: why is casting malloc a bad thing?"
- Previous message: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- In reply to: Dan Pop: "Re: why is casting malloc a bad thing?"
- Next in thread: Christian Bau: "Re: why is casting malloc a bad thing?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|