Re: C portability is a myth

From: Allin Cottrell (cottrell_at_wfu.edu)
Date: 02/26/05


Date: Fri, 25 Feb 2005 22:36:57 -0500

Keith Thompson wrote:
> Mark McIntyre <markmcintyre@spamcop.net> writes:

>>>Dammit, I showed that it was plain _wrong_. Is that not
>>>enough?
>>
>>In what way is the information that malloc is ANSI compatible wrong? Please
>>explain.
>
> I think it's about the mention of the <malloc.h> header.

It is indeed. The implication of the MSDN page is that <malloc.h>
is a standard C header. I have not found such misinformation in
*nix man pages for functions such as malloc().

Allin Cottrell



Relevant Pages

  • Re: Some general questions about C and good practice
    ... which is the implication that Stroustrup's words are ... of malloc() is considered good style because a cast there may hide ... examples use implicit casts of void pointers. ...
    (comp.lang.c)
  • Re: General rules on interface (function) design
    ... Eric Sosman wrote: ... if fopen does call malloc, ... with the implication you described, ...
    (comp.lang.c)
  • Re: What is the best alternative for realloc in C++
    ... The implication that malloc() and 'new' are equivalent is very wrong. ... There are significant differences, for example: ... failure while 'new' throws an exception, mallocallocates raw memory ...
    (comp.lang.cpp)
  • Re: why still use C?
    ... If there's a prototype in scope, the value returned by malloc() ... Keith Thompson kst@cts.com ...
    (comp.lang.c)
  • Re: calloc/free: a preplexing observation
    ... Keith Thompson wrote: ... and the system can guard against it by making the malloccall ... Please tell me how the system can differentiate between a malloc ... the broken "Reply" link at the bottom of the article. ...
    (comp.lang.c)