Re: Help with understanding this please
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Sat, 30 Aug 2008 16:32:34 +0100
"Richard" <rgrdev@xxxxxxxxx> wrote in message news:
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:It's an emphasis problem.
mdh said:
Richard...before I rest so that sleep can be calm!!, may I ask why you
have not cast the return from malloc to type "struct t_node n *).
Why on earth would I do that? What good could it possibly do?
Yeah because C++ is wrong and so was pre Ansi C.
You want to warn about potentially unsafe operations, such as converting from one type to another.
However only rarely will you want to assign the result of malloc() to a void *. In this case, the warnings are gratuitous. Too many warnings are as bad as too few, because people start ignoring them, and the genuinely exceptional casts get lost in the noise.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
.
- References:
- Re: Help with understanding this please
- From: Richard Heathfield
- Re: Help with understanding this please
- From: mdh
- Re: Help with understanding this please
- From: Richard
- Re: Help with understanding this please
- Prev by Date: Re: Help with understanding this please
- Next by Date: Re: char**
- Previous by thread: Re: Help with understanding this please
- Next by thread: Re: Help with understanding this please
- Index(es):
Relevant Pages
|