Using C++ - Problem with <cstdlib>

Ian Lance Taylor iant@google.com
Sat Aug 25 20:40:00 GMT 2012


On Sat, Aug 25, 2012 at 1:27 PM, Oleg Endo <oleg.endo@t-online.de> wrote:
>
> I'm currently playing around with an RTL pass and started using C++.
> When including <algorithm> I get the following:
>
> /usr/include/c++/4.6/cstdlib:76:8: error: attempt to use poisoned
> "calloc"
> /usr/include/c++/4.6/cstdlib:83:8: error: attempt to use poisoned
> "malloc"
> /usr/include/c++/4.6/cstdlib:89:8: error: attempt to use poisoned
> "realloc"
>
> It seems the story is old:
> http://gcc.gnu.org/ml/gcc/2009-08/msg00553.html
>
> Now that the switch to C++ has been made, how should this be handled?

Add #include <cstdlib> to system.h, right by, or perhaps replacing,
the #include <stdlib.h>.

Ian



More information about the Gcc mailing list