[ https://issues.apache.org/jira/browse/STDCXX-2?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567802#action_12567802 ] Martin Sebor commented on STDCXX-2: ----------------------------------- Btw., I note {{__rw_fix_flt}} uses the {{_WIN32}} macro to enable another workaround for a bug (or "feature," if you work for Microsoft) in the MSVC CRT, while the workaround in your patch is guarded with {{_MSC_VER}}. Even though the latter is arguably ore appropriate, I suspect they are both subtly wrong: the former will apply the workaround for gcc on Cygwin (which, presumably, doesn't need it because it uses its own C library), while the latter will (likely) fail to MinGW which I believe does sit on top of the Microsoft libc. > [MSVC] std::num_put bad formatting of 0.0 with precision and showpoint > ---------------------------------------------------------------------- > > Key: STDCXX-2 > URL: https://issues.apache.org/jira/browse/STDCXX-2 > Project: C++ Standard Library > Issue Type: Bug > Components: 22. Localization > Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0 > Environment: Windows/MSVC > Reporter: Martin Sebor > Assignee: Farid Zaripov > Fix For: 4.2.1 > > Attachments: 22.locale.num.put.stdcxx-2.cpp, num_put.cpp.diff > > Original Estimate: 4h > Time Spent: 2.5h > Remaining Estimate: 1.5h > > When compiled with MSVC (any version), the program below aborts at runtime. > $ cat t.cpp && cl -D_RWCONFIG=11s_msvc_7_1 -Ic:/contrib/cygwin/build/sebor/dev-hal/include -I./../../../../include -Ic:/contrib/cygwin/build/sebor/dev-hal/examples/stdlib/manual/../include -Ic:/contrib/cygwin/build/sebor/dev-hal/include/ansi -I./../../../.. > -Ic:/contrib/cygwin/build/sebor/dev-hal -Ic:/contrib/cygwin/build/sebor/dev-hal/examples/stdlib/manual -I. -nologo -GX -MLd -W3 -Zi -GA -GR -GF -GZ -c t.cpp && link -nologo /NODEFAULTLIB:libcpd /debug /LIBPATH:./../../../../lib /OUT:t.exe t.obj std11s_msvc_7_1.lib user32.lib t.cpp && ./t.exe > #include > #include > int main () > { > std::ostringstream strm; > strm.setf (strm.showpoint); > strm.precision (2); > strm << 0.0; > assert ("0.0" == strm.str ()); > } > Assertion failed: "0.0" == strm.str (), file t.cpp, line 13 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.