Syntactic Confectionery Delight | |
PerlMonks |
[XS] C printf() and Microsoft compilers.by syphilis (Archbishop) |
on Dec 18, 2019 at 03:15 UTC ( [id://11110314]=perlquestion: print w/replies, xml ) | Need Help?? |
syphilis has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I have an issue with the Microsoft compiler (cl) toolchain, in relation only to those perls whose $Config{ivsize} and $Config{nvsize} are both 8. Note that such a perl configuration is very common. The demo: The desired output (which I see on Linux and mingw-built windows perls) is: My only perl built using a Microsoft compiler (5.16.0 using cl 14.00.40310.41) doesn't play ball, and outputs: How do I get the output I want with this cl-built perl ? Do more modern versions of the MS toolchain enable me to get my desired output ? Any solution that involves changing the final argument that printf() takes (ie SvNV(in)) is probably not a satisfactory one. But if there's some symbol that can be defined, or some alteration to the formatting spec, then that would be great. BTW, the script only works as desired with mingw-built perls because it defines __USE_MINGW_ANSI_STDIO to a true value if perl has not already defined it. Without that definition, mingw-built perls display the same output as my cl-built perl-5.16.0. I believe the problem with the cl-built perl is a toolchain issue, not a perl one. Cheers, Rob
Back to
Seekers of Perl Wisdom
|
|