Re: Problem with malloc
From: Chris Fogelklou (chris.fogelklou_at_comhem.se)
Date: 04/04/04
- Next message: Richard Heathfield: "Re: pointer-to-pointer (invalid lvalue in unary `&)"
- Previous message: Chris Torek: "Re: malloc + 4??"
- In reply to: Richard Heathfield: "Re: Problem with malloc"
- Next in thread: Keith Thompson: "Re: Problem with malloc"
- Reply: Keith Thompson: "Re: Problem with malloc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 04 Apr 2004 17:25:47 GMT
Hi Richard,
> It doesn't. If the code works with the cast, it'll work without it, too.
I concede... I just checked and I don't actually have a compiler now that
craps out without the cast. I could swear that I have used one that would
fail without the cast, so I have just always casted... and never turned
back.
> The correct fix is to include it. Casting merely hides the problem instead
> of fixing it.
I have not disagreed with this, however, cast or no cast.
> And the correct fix is to give a prototype, by including <stdlib.h>
Ditto.
- Next message: Richard Heathfield: "Re: pointer-to-pointer (invalid lvalue in unary `&)"
- Previous message: Chris Torek: "Re: malloc + 4??"
- In reply to: Richard Heathfield: "Re: Problem with malloc"
- Next in thread: Keith Thompson: "Re: Problem with malloc"
- Reply: Keith Thompson: "Re: Problem with malloc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|