From: Rusty Russell Date: Wed, 10 Nov 2010 06:37:29 +0000 (+1030) Subject: list: fix uninitialized variable in list_add example. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=c44953a9b9e6114690968294662fc5120e674cd2 list: fix uninitialized variable in list_add example. gcc with optimization complained (correctly) about this. --- diff --git a/ccan/list/list.h b/ccan/list/list.h index 9cb41abd..3496294b 100644 --- a/ccan/list/list.h +++ b/ccan/list/list.h @@ -106,8 +106,9 @@ static inline void list_head_init(struct list_head *h) * * The list_node does not need to be initialized; it will be overwritten. * Example: - * struct child *child; + * struct child *child = malloc(sizeof(*child)); * + * child->name = "marvin"; * list_add(&parent->children, &child->list); * parent->num_children++; */