From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#10474: Building guile 2.x under mingw + msys Date: Wed, 20 Feb 2013 22:57:18 +0100 Message-ID: <87y5eisl6p.fsf@pobox.com> References: <87pqerdxq4.fsf@pobox.com> <83ehuy698u.fsf@gnu.org> <8362ga5h7h.fsf@gnu.org> <87r4ywpnv0.fsf@gnu.org> <83r4yw49u6.fsf@gnu.org> <87y5smnj86.fsf@pobox.com> <83ehudp29y.fsf@gnu.org> <87y5ekx9u2.fsf@pobox.com> <83ip5mokzx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361397486 1662 80.91.229.3 (20 Feb 2013 21:58:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 21:58:06 +0000 (UTC) Cc: ludo@gnu.org, 10474@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Feb 20 22:58:26 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U8HgH-0000Dw-Jx for guile-bugs@m.gmane.org; Wed, 20 Feb 2013 22:58:25 +0100 Original-Received: from localhost ([::1]:35122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Hfx-0006Rl-2i for guile-bugs@m.gmane.org; Wed, 20 Feb 2013 16:58:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Hfn-0006Ph-9H for bug-guile@gnu.org; Wed, 20 Feb 2013 16:58:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8Hfi-00037b-Gw for bug-guile@gnu.org; Wed, 20 Feb 2013 16:57:55 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Hfi-00037R-Az for bug-guile@gnu.org; Wed, 20 Feb 2013 16:57:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U8Hgs-0002kg-Ne for bug-guile@gnu.org; Wed, 20 Feb 2013 16:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 20 Feb 2013 21:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10474 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 10474-submit@debbugs.gnu.org id=B10474.136139752210552 (code B ref 10474); Wed, 20 Feb 2013 21:59:02 +0000 Original-Received: (at 10474) by debbugs.gnu.org; 20 Feb 2013 21:58:42 +0000 Original-Received: from localhost ([127.0.0.1]:40674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8HgX-0002k9-TG for submit@debbugs.gnu.org; Wed, 20 Feb 2013 16:58:42 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:42960 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8HgU-0002k1-Vp for 10474@debbugs.gnu.org; Wed, 20 Feb 2013 16:58:41 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 689C8CE27; Wed, 20 Feb 2013 16:57:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=vQ8hDMTb9n0JWWg4GX+cG6oZXoc=; b=OLDbJS tXr9HdjozAKlntybnXiGc5R8hJrQosKUCGJ+HaG3vOqFrYgoMJLoXZUe+0jSn0K3 AZ8fqXCyprDDWSF/ry2+5FpE+qgwXqLb0so5lnktyJhQS0mD7EG6yrCURmg24MC0 oDmUgiPMHy9OeapaesIpt1fedvwXX4oYEI9js= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=gLZMc0+rI++V9LSlJ/dLyPyZ1dgHD6bx 7gDPBXxHYIWXGxwpGWr6uwPDZM44WDKXj3r13vIy9kQSPxsHmn1ixKNX0b6yg04O JAOBI9ZYg1R2caxe1dmkb1LwpFUGAv1Ims08IjswuuNTqL6o8XebhoM4iNrG/IEy bbY7I05iM/o= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 5FEA0CE26; Wed, 20 Feb 2013 16:57:25 -0500 (EST) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id AF1C6CE25; Wed, 20 Feb 2013 16:57:24 -0500 (EST) In-Reply-To: <83ip5mokzx.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 20 Feb 2013 21:14:58 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: 827DB650-7BA8-11E2-8FA0-1C2F0E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6765 Archived-At: Hi Eli, On Wed 20 Feb 2013 20:14, Eli Zaretskii writes: >> > Avoid compiler warnings on MS-Windows. >> > >> > * libguile/print.c (display_string_using_iconv): Cast 2nd arg of >> > `iconv' to `const char **', to avoid compiler warnings. >> > >> > * libguile/ports.c (get_iconv_codepoint): Cast 2nd arg of `iconv' >> > to `const char **', to avoid compiler warnings. >> > >> > >> > --- libguile/print.c~0 2011-10-08 01:49:48.000000000 +0200 >> > +++ libguile/print.c 2012-01-15 15:10:51.450848400 +0200 >> > @@ -899,7 +899,7 @@ display_string_using_iconv (const void * >> > output = encoded_output; >> > output_left = sizeof (encoded_output); >> > >> > - done = iconv (pt->output_cd, &input, &input_left, >> > + done = iconv (pt->output_cd, (const char **)&input, &input_left, >> > &output, &output_left); >> > >> > output_len = sizeof (encoded_output) - output_left; >> > >> > >> > --- 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? >> > * libguile/mkstemp.c (O_BINARY): Define for all platforms. >> > (mkstemp): Open the temporary file in binary mode, so that >> > compiled *.go files are written verbatim on MS-Windows. >> >> Hummmmmmm. It's true that the only user of mkstemp in Guile is the >> compilation code. OTOH it's a public interface, and this change might >> affect someone. OTOH MinGW is not well-served currently and probably >> there are ~0 active users. Any other thoughts here? > > An alternative would be to provide a public interface to switch an > existing file descriptor to binary mode, and then use it from the code > that calls mkstemp to output what will eventually become a *.go file. You know, given that temporary files are for writing more than for reading, it makes sense to just add the O_BINARY flag and be done with it. I'll do that. >> > * libguile/net_db.c [HAVE_WINSOCK2_H]: Add !GNULIB_TEST_SOCKET to >> > the condition, to include sys/socket.h and netdb.h when gnulib's >> > socket module is being used. Fixes compiler warnings and errors >> > on MS-Windows. >> > >> > * libguile/socket.c: Likewise. >> > >> > >> > --- libguile/net_db.c~0 2011-07-07 02:49:59.000000000 +0300 >> > +++ libguile/net_db.c 2012-01-15 16:22:56.366898100 +0200 >> > @@ -49,8 +49,11 @@ >> > >> > #include >> > >> > -#ifdef HAVE_WINSOCK2_H >> > +#if HAVE_WINSOCK2_H && !GNULIB_TEST_SOCKET >> > #include >> > +# if HAVE_WS2TCPIP_H >> > +# include >> > +# endif >> > #else >> > #include >> > #include >> >> Surely we should just rely on Gnulib here and not include the winsock >> headers. In what condition would these headers be included otherwise? >> A visual studio build or something? > > Sorry, I have no idea. If relying on gnulib is OK for non-MinGW > Windows platforms (if there are such), then it's fine with me. I think for now this is the right thing. It seems that even visual studio builds are supported by gnulib, so the specs we code against should either be posix or gnulib abstractions. I have removed this #if block. Thanks, Andy -- http://wingolog.org/