This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


>   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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]