[PATCH XTS 2/2] xts5: Fix 'missing sentinel in function call' warnings by using literal NULL

Nick Bowler nbowler at draconx.ca
Thu Apr 14 16:34:49 PDT 2011


On Tue, 12 Apr 2011 17:29:07 -0700, Aaron Plattner wrote:
> -char *endlist = NULL;
[...]
>  					att->va = XVaCreateNestedList(dummy,
>  						ils->name,
>  						(XPointer)ils->val->win,
> -						endlist);
> +						NULL);

This change is wrong; if NULL is defined to 0 (as permitted by the C
standard), this will end up passing an int to the function instead of
the right kind of pointer, and chaos may ensue, especially if int and
char * have different sizes.

Thus, you must use (char *)NULL.

Many other hunks in this patch have the same problem.



More information about the xorg-devel mailing list