develooper Front page | perl.perl5.porters | Postings from December 2016

[perl #130447] Win32: Define __USE_MINGW_ANSI_STDIO for all gccbuilds

From:
Sisyphus
Date:
December 30, 2016 00:04
Subject:
[perl #130447] Win32: Define __USE_MINGW_ANSI_STDIO for all gccbuilds
Message ID:
rt-4.0.24-19112-1483056273-1610.130447-75-0@perl.org
# New Ticket Created by  "Sisyphus" 
# Please include the string:  [perl #130447]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=130447 >


Hi,

Currently the win32/makefile.mk and win32/GNUmakefile that ship with the
perl source contain instructions that conditionally define
__USE_MINGW_ANSI_STDIO.

In win32/makefile.mk:

.IF "$(USE_LONG_DOUBLE)" == "define"
BUILDOPT        += -D__USE_MINGW_ANSI_STDIO
MINIBUILDOPT    += -D__USE_MINGW_ANSI_STDIO
.ENDIF

In win32/GNUmakefile:

ifeq ($(USE_LONG_DOUBLE),define)
BUILDOPT        += -D__USE_MINGW_ANSI_STDIO
MINIBUILDOPT    += -D__USE_MINGW_ANSI_STDIO
endif

It would be better if the condition was changed so that the symbol is
defined whenever $(CCTYPE) is GCC.

Looks to me that the above sections are already inside a "$(CCTYPE) is GCC"
block, so it's just a matter of removing the .IF and .ENDIF (or ifeq and
endif) lines from the respective makefiles.

This removes laughable behaviour from "nvtype is double" mingw builds of
perl on Windows.

For example, a usual "nvtype is double" mingw build of perl-5.25.7
(__USE_MINGW_ANSI_STDIO *not* defined) produces

C:\>perl -MPOSIX="DBL_MAX" -le "printf '%f', DBL_MAX;"
17976931348623157000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000.000000
C:\>perl -V:nvtype
nvtype='double';

But if the same perl source is built *with* __USE_MINGW_ANSI_STDIO (achieved
by having modified the GNUmakefile as per above) then the output changes to
the correct:

C:\>perl -MPOSIX="DBL_MAX" -le "printf '%f', DBL_MAX;"
17976931348623157081452742373170435679807056752584499659891747680315726078002853
87605895586327668781715404589535143824642343213268894641827684675467035375169860
49910576551282076245490090389328944075868508455133942304583236903222948165808559
332123348274797826204144723168738177180919299881250404026184124858368.000000
C:\>perl -V:nvtype
nvtype='double';

I've just built  and installed both 32-bit and 64-bit versions of
perl-5.25.8, nvtype='double', using the modified win32/GNUmakefile so that
__USE_MINGW_ANSI_STDIO is defined. The 32-bit test report is:

Test Summary Report
-------------------
porting/pod_rules.t                                              (Wstat: 0
Tests: 8 Failed: 1)
  Failed test:  3
../ext/IPC-Open3/t/IPC-Open3.t                                   (Wstat: 0
Tests: 45 Failed: 0)
  TODO passed:   25
Files=2541, Tests=1029438, 1295 wallclock secs (53.21 usr +  2.53 sys =
55.74 CPU)
Result: FAIL
GNUmakefile:1755: recipe for target 'test' failed
make: *** [test] Error 1

This is no different to the report obtained when I built 5.25.7 *without*
defining __USE_MINGW_ANSI_STDIO.

I can't run the entire test suite for the 5.25.8 x64, nvtype='double' build
because it hangs at:

../cpan/IO-Compress/t/100generic-deflate.t ......................... 1/794

(This happens irrespective of whether __USE_MINGW_ANSI_STDIO is defined.)

Cheers,
Rob 




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About