[LCP]sizeof question.

David filiond at videotron.ca
Sat Sep 21 03:12:01 UTC 2002


A wrote:
> 
> On Friday 20 September 2002 2:48 pm, you wrote:
> #
> # I added the case because the compiler complains if I don't.
> # SUN Workshop, not gcc :(, unfortunaltly.
> #
> 
> That is most likely because you have missed out
>     #include<stdlib.h>
> which includes the prototype for the malloc family. With this missed out the
> compiler assumes that the return type will be int and therfore requires the
> cast. This is the kind of error that gets masked with casts.
> 
> ----A
> 
Nope.  It's there. 
I added the case because the calloc is in C file that is being included
as part of a c++ project.  It's the c++ compiler that bitches, not the C
compiler.


-- 
David Filion		filiond[at]videotron[dot]ca
Linux counter #195143

"Yes, it's manly, but let's face it, so is bungee-jumping with the
 cord tied to your testicles." -- Linus Torvalds



More information about the linuxCprogramming mailing list