[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    Re: [PATCH 5/9] loader: warning fix
From:       Mark Kettenis <mark.kettenis () xs4all ! nl>
Date:       2010-10-31 15:05:08
Message-ID: 201010311505.o9VF58RE001667 () glazunov ! sibelius ! xs4all ! nl
[Download RAW message or body]

> From: Adam Jackson <ajax@redhat.com>
> Date: Tue, 19 Oct 2010 11:59:20 -0400
> 
> loadmod.c: In function ‘FreeSubdirs':
> loadmod.c:377: warning: passing argument 1 of ‘free' discards qualifiers
> from pointer target type
> /usr/include/stdlib.h:488: note: expected ‘void *' but argument is of
> type ‘const char *'

This strongly suggest that the argument to FreeSubdirs() shouldn't
have been const in the first place.

> diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
> index 6e65227..d799432 100644
> --- a/hw/xfree86/loader/loadmod.c
> +++ b/hw/xfree86/loader/loadmod.c
> @@ -374,7 +374,7 @@ FreeSubdirs(const char **subdirs)
>  
>      if (subdirs) {
>  	for (s = subdirs; *s; s++)
> -	    free(*s);
> +	    free((char *)*s);
>  	free(subdirs);
>      }
>  }


_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic