[PATCH:xserver] Fix uninitialized variable warnings reported by clang. (was Re: [PATCH:xf86-video-ati] Fix uninitialized variable warnings reported by clang.)

Michel Dänzer michel at daenzer.net
Tue Dec 15 17:24:39 PST 2015


On 15.12.2015 19:04, Thomas Klausner wrote:
> Like this?

[...]

> diff --git a/include/list.h b/include/list.h
> index 39f1985..f41d418 100644
> --- a/include/list.h
> +++ b/include/list.h
> @@ -317,6 +317,7 @@ xorg_list_is_empty(struct xorg_list *head)
>   * See xorg_list_for_each_entry for more details.
>   */
>  #define xorg_list_for_each_entry_safe(pos, tmp, head, member)		\
> +    pos = NULL;								\
>      for (pos = __container_of((head)->next, pos, member),		\
>  	 tmp = __container_of(pos->member.next, pos, member);		\
>  	 &pos->member != (head);					\

Yes, but the xorg_list_for_each_entry macro needs the same treatment.
With that,

Acked-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list