mapi32: Write-strings warnings fix

Andrew Talbot Andrew.Talbot at talbotville.com
Sat Jun 3 15:06:11 CDT 2006


Hans Leidekker wrote:
> That won't do either because these pointers are dereferenced a few lines
> further down. How about this patch?
>  
> -    char *address = "", *to = NULL, *cc = NULL, *bcc = NULL, *subject,
> *body;
> +    char *to = NULL, *cc = NULL, *bcc = NULL;
> +    const char *subject, *body, *address = "";
> 
>  -Hans

The problem is that the SDK defines the strings as non-const, so making
subject and body const char * would cause a qual-cast violation.

I think there are two solutions:

1) I could put casts in the sprintf() line, thus:

    sprintf( mailto, format, to ? to : "", (char *) subject, cc ? cc : "",                
bcc ? bcc : "", (char *) body );

or

2) I could define

    const CHAR empty[] = "";

and reinstate the original ?: construct. I'm not sure which is best, if
either.

-- Andy.





More information about the wine-devel mailing list