[PATCH:libXt 5/6] Silence compiler clang warnings.
Alan Coopersmith
alan.coopersmith at oracle.com
Tue Jul 9 23:40:34 PDT 2013
On 06/25/13 02:02 PM, Thomas Klausner wrote:
> Fixes:
> warning: cast from function call of type 'char *' to non-matching
> type 'XtArgVal' (aka 'long') [-Wbad-function-cast]
> ---
> src/Resources.c | 2 +-
> src/Varargs.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/Resources.c b/src/Resources.c
> index 1d2871c..657c55d 100644
> --- a/src/Resources.c
> +++ b/src/Resources.c
> @@ -738,7 +738,7 @@ static XtCacheRef *GetResources(
> */
>
> if(rx->xrm_size > sizeof(XtArgVal)) {
> - arg->value = (XtArgVal) __XtMalloc(rx->xrm_size);
> + arg->value = (XtArgVal)(void *) __XtMalloc(rx->xrm_size);
*sigh* __XtMalloc should really be returning (void *), not (char *).
XtArgVal should not be defined to be "char *" on some platforms (well, CRAY),
"long" on others.
Xt should really just die in a fire as an unsalvageable mess of bad types.
I am really running out of reasons to give a crap about this any more, and
since no one else does either (at least from what I can tell by the lack of
anyone else doing patch reviews or commits), I may just follow their lead
and ignore this.
--
-Alan Coopersmith- alan.coopersmith at oracle.com
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
More information about the xorg-devel
mailing list