Write-strings warning fix

Andrew Talbot Andrew.Talbot at talbotville.com
Fri Aug 25 05:08:03 CDT 2006

Dmitry Timoshkov wrote:

> Here is a more intrusive, but IMO a more correct fix.
> -    free(name);
> +    free((void *)name);
> change is questionable, but unavoidable.


Hi Dmitry,

I did, at one point, travel down the road you suggest, but, that way, we
would be eliminating a write-strings warning but replacing it with a
cast-qual warning, which seems like no net gain. And as I am now fixing
cast-qual warnings, well, you can imagine how I feel about that. :-)

What confused me - especially with my ignorance of yacc - is that I couldn't
find a corresponding xmalloc() that assigns the char * variables that the
above free() frees. make_var() gains storage for a var_t type, but the
free() in get_type() releases the storage of a char *. I couldn't quite
follow what was going on, there. Is it because the string is the first
element in the structure, so the pointer to the string also points to the
start of the var_t type?

-- Andy.

More information about the wine-patches mailing list