This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RE: assigning a pointer to linked list to stuct element, changes list
- To: gcc-bugs at gcc dot gnu dot org
- Subject: RE: assigning a pointer to linked list to stuct element, changes list
- From: Tom Truscott <trt at unx dot sas dot com>
- Date: Wed, 17 Nov 1999 11:43:52 -0500 (EST)
> 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