Subject: bug#10474: Building guile 2.x under mingw + msys

From: Eli Zaretskii <[email-masked]>
Date: Thu, 21 Feb 2013 05:49:00 +0200

> From: Andy Wingo <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Wed, 20 Feb 2013 22:57:18 +0100
> 
> >> > --- libguile/ports.c~0	2011-10-08 01:49:48.000000000 +0200
> >> > +++ libguile/ports.c	2012-01-15 15:11:11.856706600 +0200
> >> > @@ -1305,7 +1305,7 @@ get_iconv_codepoint (SCM port, scm_t_wch
> >> >        input_left = bytes_consumed + 1;
> >> >        output_left = sizeof (utf8_buf);
> >> >  
> >> > -      done = iconv (pt->input_cd, &input, &input_left,
> >> > +      done = iconv (pt->input_cd, (const char **)&input, &input_left,
> >> >  		    &output, &output_left);
> >> >        if (done == (size_t) -1)
> >> >  	{
> >> >
> >> 
> >> However iconv is specified
> >> (http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html) to
> >> take a char** as the first argument.  Don't we end up using a GNU iconv
> >> on mingw32 anyway?
> >
> > Yes, we do use GNU iconv.  However, the version of iconv.h (from GNU
> > iconv version 1.13, I think) that I have declares the function like
> > this:
> >
> >   extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
> 
> In these files, `input' is a char*.  So &input should be a char**.
> Shouldn't that cast to const char** without a warning?

Maybe it's some obscure bug my compiler.  If you can get away without
a warning in such situations, even when the prototype does specify
"const char **", then feel free to disregard these changes.  They are
certainly not Windows or MinGW specific.