assigning a pointer to linked list to stuct element, changes list

Tom Truscott trt@unx.sas.com
Tue Nov 30 23:39:00 GMT 1999


>   if (NULL == (mpool_node = malloc (sizeof (mpool_node))))

That should instead be:

    if (NULL == (mpool_node = malloc (sizeof (*mpool_node))))
					      ^
This is such a common mistake that it would be nice if gcc
issued a warning.

Tom Truscott



More information about the Gcc-bugs mailing list