[GCC-XML] Error: attempt to use poisoned "calloc"

Brad King brad.king at kitware.com
Thu Jan 19 12:03:06 EST 2006


Daniel J. Lauk wrote:
> Hi there.
> 
> I tried to do a <code>char *foo = calloc(bar + 1, sizeof(char));</code> and 
> that gave me this wonderful error message:
> /path/to/file.c:123:45: error: attempt to use poisoned "calloc"
> 
> Has anybody an idea different from using a fixed size array?

GCC sources don't want anyone to use "calloc".  Use "malloc" instead:

char* foo = (char*)malloc((bar+1)*sizeof(char));

-Brad



More information about the gccxml mailing list