On Mon, 30 Jan 2006, Hans Aberg wrote:

> It is Paul Eggert that is doing the C skeleton, and I doubt he does anything
> with C++ in mind.

It is his posts where I first saw the malloc issue addressed in bison.

> And a strict C++ compiler will complain when
> using names such as "malloc", as the C++ name is "std::malloc". Is your C++
> compiler old?

Using g++ 4.0.1 (with -Wall -pedantic) or Sun's CC 5.7, the following 
compiles without warning:

  #include <stdlib.h>
  #include <stdio.h>
  int main() {
    int *p = (int*)malloc(3);
    printf ("%d\n", *p);
    return 0;
  }

Perhaps you're thinking of <cstdlib> rather than <stdlib.h>?

Joel


Reply via email to