From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.bugs Subject: bug#10474: Building guile 2.x under mingw + msys Date: Wed, 20 Feb 2013 21:14:58 +0200 Message-ID: <83ip5mokzx.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1361387775 3485 80.91.229.3 (20 Feb 2013 19:16:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 19:16:15 +0000 (UTC) Cc: ludo@gnu.org, 10474@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Feb 20 20:16:34 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 1U8F9W-00060F-08 for guile-bugs@m.gmane.org; Wed, 20 Feb 2013 20:16:26 +0100 Original-Received: from localhost ([::1]:55020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8F9B-0003wf-Fb for guile-bugs@m.gmane.org; Wed, 20 Feb 2013 14:16:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8F92-0003uw-I3 for bug-guile@gnu.org; Wed, 20 Feb 2013 14:16:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8F8w-0001yH-JD for bug-guile@gnu.org; Wed, 20 Feb 2013 14:15:56 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8F8w-0001y7-78 for bug-guile@gnu.org; Wed, 20 Feb 2013 14:15:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U8FA6-0007An-85 for bug-guile@gnu.org; Wed, 20 Feb 2013 14:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 20 Feb 2013 19:17: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.136138776327494 (code B ref 10474); Wed, 20 Feb 2013 19:17:02 +0000 Original-Received: (at 10474) by debbugs.gnu.org; 20 Feb 2013 19:16:03 +0000 Original-Received: from localhost ([127.0.0.1]:40489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8F97-000796-Mq for submit@debbugs.gnu.org; Wed, 20 Feb 2013 14:16:02 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:44452) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8F95-00078z-Tm for 10474@debbugs.gnu.org; Wed, 20 Feb 2013 14:16:01 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MIJ00G008288X00@a-mtaout23.012.net.il> for 10474@debbugs.gnu.org; Wed, 20 Feb 2013 21:14:46 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MIJ00GW19GK8590@a-mtaout23.012.net.il>; Wed, 20 Feb 2013 21:14:44 +0200 (IST) In-reply-to: <87y5ekx9u2.fsf@pobox.com> X-012-Sender: halo1@inter.net.il 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:6763 Archived-At: > From: Andy Wingo > Cc: ludo@gnu.org, 10474@debbugs.gnu.org > Date: Tue, 19 Feb 2013 22:39:01 +0100 > > Sorry for the large number of mails. Don't worry about that. > > 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); > > (make_objcode_from_file): Zero out errno before calling full_read, > > to make sure the value after the call reflects errors inside > > full_read. > > This seems like a bug to me, that the behavior of full_read can depend > on the incoming errno. I mailed bug-gnulib and put you on copy to see > what they would say. As I wrote there, I suggest to add some application-level diagnostics in this case, something like "premature end of file". > > * 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. > > * 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.