[LCP]sizeof question.

Greg Black gjb at gbch.net
Sat Sep 21 08:10:01 UTC 2002


A wrote:

| On Friday 20 September 2002 8:13 pm, you wrote:
| # 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.
| 
| That is quite interesting. As I understood it the C89 standard was fully 
| incorporated into the C++ 98 standard (which was then deviated from with C99) 
| which would mean that the c++ library stdlib should have the C style calloc 
| prototype in it. I'll remember not to use the sun c++ compiler then ;-), who 
| knows where they've put things.

You've missed the point -- you can't compile C with a C++
compiler.  They are different languages.  The cast is required
in C++ and is a mistake in C.  If you write C, you should use a
C compiler.

Greg



More information about the linuxCprogramming mailing list