You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2008/04/18 02:45:23 UTC
[jira] Created: (STDCXX-880) num_put::put(..., 1.0e+4932L, ...)
formats "inf"
num_put::put(..., 1.0e+4932L, ...) formats "inf"
------------------------------------------------
Key: STDCXX-880
URL: https://issues.apache.org/jira/browse/STDCXX-880
Project: C++ Standard Library
Issue Type: Bug
Components: 22. Localization
Affects Versions: trunk
Reporter: Martin Sebor
Priority: Blocker
Fix For: 4.2.1
The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
{noformat}
$ cat t.cpp && gmake t && ./t
#include <cassert>
#include <cstdio>
#include <math.h>
#include <sstream>
int main ()
{
const long double x = 1.0e+4932L;
assert (isnormal (x));
std::ostringstream strm;
strm << x;
char buf [40];
std::sprintf (buf, "%Lg", x);
if (strm.str () == buf)
return 0;
std::printf ("%s != %s\n", strm.str ().c_str (), buf);
assert (0);
}
aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
t.cpp
"/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
pointless comparison of unsigned integer with zero
if ( 0 <= __c
^
"/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
pointless comparison of unsigned integer with zero
if ( 0 <= __c
^
aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
/rwtest -lstd15D -lm
inf != 1e+4932
Assertion failed: 0, file t.cpp, line 22
ABORT instruction (core dumped)
{noformat}
The output of {{22.locale.num.put}} follows:
{noformat}
$ ./22.locale.num.put -q
# ASSERTION (S7) (4 lines):
# TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
# CLAUSE: lib.locale.num.put
# LINE: 1854
# ASSERTION (S7) (4 lines):
# TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
# CLAUSE: lib.locale.num.put
# LINE: 1958
# ASSERTION (S7) (4 lines):
# TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
# CLAUSE: lib.locale.num.put
# LINE: 1854
# ASSERTION (S7) (4 lines):
# TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
# CLAUSE: lib.locale.num.put
# LINE: 1958
# +-----------------------+----------+----------+----------+
# | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
# +-----------------------+----------+----------+----------+
# | (S1) INFO | 96 | 96 | 0% |
# | (S2) NOTE | 1 | 1 | 0% |
# | (S5) WARNING | 2 | 2 | 0% |
# | (S7) ASSERTION | 4 | 1671 | 99% |
# +-----------------------+----------+----------+----------+
{noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (STDCXX-880) num_put::put(..., 1.0e+4932L, ...)
formats "inf"
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor reassigned STDCXX-880:
-----------------------------------
Assignee: Farid Zaripov
Reverting [r646396|http://svn.apache.org/viewvc?view=rev&revision=646396] fixes the problem.
Farid please take a look at this.
> num_put::put(..., 1.0e+4932L, ...) formats "inf"
> ------------------------------------------------
>
> Key: STDCXX-880
> URL: https://issues.apache.org/jira/browse/STDCXX-880
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: trunk
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Blocker
> Fix For: 4.2.1
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
> {noformat}
> $ cat t.cpp && gmake t && ./t
> #include <cassert>
> #include <cstdio>
> #include <math.h>
> #include <sstream>
> int main ()
> {
> const long double x = 1.0e+4932L;
> assert (isnormal (x));
> std::ostringstream strm;
> strm << x;
> char buf [40];
> std::sprintf (buf, "%Lg", x);
> if (strm.str () == buf)
> return 0;
> std::printf ("%s != %s\n", strm.str ().c_str (), buf);
> assert (0);
> }
> aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
> or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
> ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
> 487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
> t.cpp
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
> ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
> ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
> /rwtest -lstd15D -lm
> inf != 1e+4932
> Assertion failed: 0, file t.cpp, line 22
> ABORT instruction (core dumped)
> {noformat}
> The output of {{22.locale.num.put}} follows:
> {noformat}
> $ ./22.locale.num.put -q
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO | 96 | 96 | 0% |
> # | (S2) NOTE | 1 | 1 | 0% |
> # | (S5) WARNING | 2 | 2 | 0% |
> # | (S7) ASSERTION | 4 | 1671 | 99% |
> # +-----------------------+----------+----------+----------+
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (STDCXX-880) num_put::put(..., 1.0e+4932L, ...)
formats "inf"
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov closed STDCXX-880.
--------------------------------
Merged in 4.2.x branch thus: http://svn.apache.org/viewvc?rev=651034&view=rev
> num_put::put(..., 1.0e+4932L, ...) formats "inf"
> ------------------------------------------------
>
> Key: STDCXX-880
> URL: https://issues.apache.org/jira/browse/STDCXX-880
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: trunk
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Blocker
> Fix For: 4.2.1
>
> Attachments: num_put.cpp.diff
>
> Original Estimate: 2h
> Time Spent: 1h
> Remaining Estimate: 1h
>
> The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
> {noformat}
> $ cat t.cpp && gmake t && ./t
> #include <cassert>
> #include <cstdio>
> #include <math.h>
> #include <sstream>
> int main ()
> {
> const long double x = 1.0e+4932L;
> assert (isnormal (x));
> std::ostringstream strm;
> strm << x;
> char buf [40];
> std::sprintf (buf, "%Lg", x);
> if (strm.str () == buf)
> return 0;
> std::printf ("%s != %s\n", strm.str ().c_str (), buf);
> assert (0);
> }
> aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
> or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
> ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
> 487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
> t.cpp
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
> ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
> ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
> /rwtest -lstd15D -lm
> inf != 1e+4932
> Assertion failed: 0, file t.cpp, line 22
> ABORT instruction (core dumped)
> {noformat}
> The output of {{22.locale.num.put}} follows:
> {noformat}
> $ ./22.locale.num.put -q
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO | 96 | 96 | 0% |
> # | (S2) NOTE | 1 | 1 | 0% |
> # | (S5) WARNING | 2 | 2 | 0% |
> # | (S7) ASSERTION | 4 | 1671 | 99% |
> # +-----------------------+----------+----------+----------+
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (STDCXX-880) num_put::put(...,
1.0e+4932L, ...) formats "inf"
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12590256#action_12590256 ]
sebor edited comment on STDCXX-880 at 4/17/08 5:50 PM:
--------------------------------------------------------------
Reverting [r646396|http://svn.apache.org/viewvc?view=rev&revision=646396] fixes the problem.
Farid please take a look at this (FWIW, it looks like we're missing long double overloads for the new functions added in the change).
was (Author: sebor):
Reverting [r646396|http://svn.apache.org/viewvc?view=rev&revision=646396] fixes the problem.
Farid please take a look at this.
> num_put::put(..., 1.0e+4932L, ...) formats "inf"
> ------------------------------------------------
>
> Key: STDCXX-880
> URL: https://issues.apache.org/jira/browse/STDCXX-880
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: trunk
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Blocker
> Fix For: 4.2.1
>
> Original Estimate: 2h
> Time Spent: 1h
> Remaining Estimate: 1h
>
> The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
> {noformat}
> $ cat t.cpp && gmake t && ./t
> #include <cassert>
> #include <cstdio>
> #include <math.h>
> #include <sstream>
> int main ()
> {
> const long double x = 1.0e+4932L;
> assert (isnormal (x));
> std::ostringstream strm;
> strm << x;
> char buf [40];
> std::sprintf (buf, "%Lg", x);
> if (strm.str () == buf)
> return 0;
> std::printf ("%s != %s\n", strm.str ().c_str (), buf);
> assert (0);
> }
> aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
> or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
> ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
> 487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
> t.cpp
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
> ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
> ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
> /rwtest -lstd15D -lm
> inf != 1e+4932
> Assertion failed: 0, file t.cpp, line 22
> ABORT instruction (core dumped)
> {noformat}
> The output of {{22.locale.num.put}} follows:
> {noformat}
> $ ./22.locale.num.put -q
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO | 96 | 96 | 0% |
> # | (S2) NOTE | 1 | 1 | 0% |
> # | (S5) WARNING | 2 | 2 | 0% |
> # | (S7) ASSERTION | 4 | 1671 | 99% |
> # +-----------------------+----------+----------+----------+
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-880) num_put::put(..., 1.0e+4932L, ...)
formats "inf"
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12590385#action_12590385 ]
Farid Zaripov commented on STDCXX-880:
--------------------------------------
I'm only not sure about Solaris OS. I don't see in the documentation at docs.sun.com that there are present fpclass(), finite(), ... functions for long double type.
But now we need the only finite() implemented for long double. Other functions can be implemented for double type (I believe that inf and nan values are correctly converting from long double into double).
> num_put::put(..., 1.0e+4932L, ...) formats "inf"
> ------------------------------------------------
>
> Key: STDCXX-880
> URL: https://issues.apache.org/jira/browse/STDCXX-880
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: trunk
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Blocker
> Fix For: 4.2.1
>
> Attachments: num_put.cpp.diff
>
> Original Estimate: 2h
> Time Spent: 1h
> Remaining Estimate: 1h
>
> The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
> {noformat}
> $ cat t.cpp && gmake t && ./t
> #include <cassert>
> #include <cstdio>
> #include <math.h>
> #include <sstream>
> int main ()
> {
> const long double x = 1.0e+4932L;
> assert (isnormal (x));
> std::ostringstream strm;
> strm << x;
> char buf [40];
> std::sprintf (buf, "%Lg", x);
> if (strm.str () == buf)
> return 0;
> std::printf ("%s != %s\n", strm.str ().c_str (), buf);
> assert (0);
> }
> aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
> or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
> ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
> 487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
> t.cpp
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
> ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
> ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
> /rwtest -lstd15D -lm
> inf != 1e+4932
> Assertion failed: 0, file t.cpp, line 22
> ABORT instruction (core dumped)
> {noformat}
> The output of {{22.locale.num.put}} follows:
> {noformat}
> $ ./22.locale.num.put -q
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO | 96 | 96 | 0% |
> # | (S2) NOTE | 1 | 1 | 0% |
> # | (S5) WARNING | 2 | 2 | 0% |
> # | (S7) ASSERTION | 4 | 1671 | 99% |
> # +-----------------------+----------+----------+----------+
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (STDCXX-880) num_put::put(..., 1.0e+4932L, ...)
formats "inf"
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov resolved STDCXX-880.
----------------------------------
Resolution: Fixed
Fixed in trunk thus http://svn.apache.org/viewvc?rev=650902&view=rev and http://svn.apache.org/viewvc?rev=650933&view=rev
Will be closed after merging the chanbges in 4.2.x branch.
> num_put::put(..., 1.0e+4932L, ...) formats "inf"
> ------------------------------------------------
>
> Key: STDCXX-880
> URL: https://issues.apache.org/jira/browse/STDCXX-880
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: trunk
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Blocker
> Fix For: 4.2.1
>
> Attachments: num_put.cpp.diff
>
> Original Estimate: 2h
> Time Spent: 1h
> Remaining Estimate: 1h
>
> The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
> {noformat}
> $ cat t.cpp && gmake t && ./t
> #include <cassert>
> #include <cstdio>
> #include <math.h>
> #include <sstream>
> int main ()
> {
> const long double x = 1.0e+4932L;
> assert (isnormal (x));
> std::ostringstream strm;
> strm << x;
> char buf [40];
> std::sprintf (buf, "%Lg", x);
> if (strm.str () == buf)
> return 0;
> std::printf ("%s != %s\n", strm.str ().c_str (), buf);
> assert (0);
> }
> aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
> or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
> ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
> 487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
> t.cpp
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
> ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
> ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
> /rwtest -lstd15D -lm
> inf != 1e+4932
> Assertion failed: 0, file t.cpp, line 22
> ABORT instruction (core dumped)
> {noformat}
> The output of {{22.locale.num.put}} follows:
> {noformat}
> $ ./22.locale.num.put -q
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO | 96 | 96 | 0% |
> # | (S2) NOTE | 1 | 1 | 0% |
> # | (S5) WARNING | 2 | 2 | 0% |
> # | (S7) ASSERTION | 4 | 1671 | 99% |
> # +-----------------------+----------+----------+----------+
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-880) num_put::put(..., 1.0e+4932L, ...)
formats "inf"
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov updated STDCXX-880:
---------------------------------
Attachment: num_put.cpp.diff
The patch is attached.
ChangeLog:
{noformat}
STDCXX-880
* src/num_put.cpp (max_double_t): New typedef for defining the
floating-point type with max precision. Implement generic functions
that not using the math library functions, instead of just "return false".
(__rw_isfinite): Define function for max_double_t type instead of double.
(__rw_signbit): Ditto.
(__rw_isinf): Ditto.
(__rw_isnan): Ditto.
(__rw_isqnan): Ditto.
(__rw_issnan): Ditto.
(__rw_fmat_infinite): Ditto.
{noformat}
> num_put::put(..., 1.0e+4932L, ...) formats "inf"
> ------------------------------------------------
>
> Key: STDCXX-880
> URL: https://issues.apache.org/jira/browse/STDCXX-880
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: trunk
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Blocker
> Fix For: 4.2.1
>
> Attachments: num_put.cpp.diff
>
> Original Estimate: 2h
> Time Spent: 1h
> Remaining Estimate: 1h
>
> The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
> {noformat}
> $ cat t.cpp && gmake t && ./t
> #include <cassert>
> #include <cstdio>
> #include <math.h>
> #include <sstream>
> int main ()
> {
> const long double x = 1.0e+4932L;
> assert (isnormal (x));
> std::ostringstream strm;
> strm << x;
> char buf [40];
> std::sprintf (buf, "%Lg", x);
> if (strm.str () == buf)
> return 0;
> std::printf ("%s != %s\n", strm.str ().c_str (), buf);
> assert (0);
> }
> aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
> or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
> ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
> 487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
> t.cpp
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
> ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
> ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
> /rwtest -lstd15D -lm
> inf != 1e+4932
> Assertion failed: 0, file t.cpp, line 22
> ABORT instruction (core dumped)
> {noformat}
> The output of {{22.locale.num.put}} follows:
> {noformat}
> $ ./22.locale.num.put -q
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO | 96 | 96 | 0% |
> # | (S2) NOTE | 1 | 1 | 0% |
> # | (S5) WARNING | 2 | 2 | 0% |
> # | (S7) ASSERTION | 4 | 1671 | 99% |
> # +-----------------------+----------+----------+----------+
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-880) num_put::put(..., 1.0e+4932L, ...)
formats "inf"
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591147#action_12591147 ]
Martin Sebor commented on STDCXX-880:
-------------------------------------
I'm not sure about converting {{double}} to {{max_double_t}}. Is it safe in terms of traps and floating point exceptions? Is it efficient? Why can't we just have three overloads of these functions for each of the three floating point types?
In any event, it's far too late to be changing the implementation of the {{double}} overloads to {{long double}}, or to be adding non-trivial implementations the generic functions for 4.2.1. Besides, the new generic functions are unsafe. They must avoid traps, so any kind of floating point arithmetic is out of the question. On platforms with limited support for these kinds of things (e.g., HP-UX on PA-RISC where the arguments must be {{float}} or {{double}} -- see for example the [{{fpclassify(3m)}}|http://docs.hp.com/en/B2355-60130/fpclassify.3M.html] HP-UX man page) we'll have to implement our own versions by examining the bit patterns ourselves.
For 4.2.1, we need the simplest, safest possible fix, or we need to revert the patch.
> num_put::put(..., 1.0e+4932L, ...) formats "inf"
> ------------------------------------------------
>
> Key: STDCXX-880
> URL: https://issues.apache.org/jira/browse/STDCXX-880
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: trunk
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Blocker
> Fix For: 4.2.1
>
> Attachments: num_put.cpp.diff
>
> Original Estimate: 2h
> Time Spent: 1h
> Remaining Estimate: 1h
>
> The [{{22.locale.num.put.cpp}}|http://svn.apache.org/repos/asf/stdcxx/trunk/tests/localization/22.locale.num.put.cpp] fails 4 assertions with the head of trunk (see below). The test passes at 100% with 4.2.0. I reduced the failures to the following test case:
> {noformat}
> $ cat t.cpp && gmake t && ./t
> #include <cassert>
> #include <cstdio>
> #include <math.h>
> #include <sstream>
> int main ()
> {
> const long double x = 1.0e+4932L;
> assert (isnormal (x));
> std::ostringstream strm;
> strm << x;
> char buf [40];
> std::sprintf (buf, "%Lg", x);
> if (strm.str () == buf)
> return 0;
> std::printf ("%s != %s\n", strm.str ().c_str (), buf);
> assert (0);
> }
> aCC -c -D_RWSTDDEBUG -mt -I/amd/devco/sebor/stdcxx-4.2.x/include -I/build/seb
> or/stdcxx-4.2.x-aCC-6.16-15D//include -I/amd/devco/sebor/stdcxx-4.2.x/tests/incl
> ude -AA -g +d +DD64 +w +W392,655,684,818,819,849 +W2193,2236,2261,2340,2401,2
> 487 +W4227,4229,4231,4235,4237,4249 +W4255,4272,4284,4285,4286,4296,4297 +W3348
> t.cpp
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 545: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> "/amd/devco/sebor/stdcxx-4.2.x/include/loc/_ctype.h", line 555: warning #2186-D:
>
> pointless comparison of unsigned integer with zero
> if ( 0 <= __c
> ^
> aCC t.o -o t -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//rwtest -lrwtest15D -AA +n
> ostl -Wl,+s -mt +DD64 -L/build/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib -Wl,+b/bu
> ild/sebor/stdcxx-4.2.x-aCC-6.16-15D//lib:/build/sebor/stdcxx-4.2.x-aCC-6.16-15D/
> /rwtest -lstd15D -lm
> inf != 1e+4932
> Assertion failed: 0, file t.cpp, line 22
> ABORT instruction (core dumped)
> {noformat}
> The output of {{22.locale.num.put}} follows:
> {noformat}
> $ ./22.locale.num.put -q
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1.18973e+4932) wrote "inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<char>::put (..., long double = 1e+4932) wrote "inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1.18973e+4932) wrote L"inf", expected "1.18973149535723176508575932662800702e+4932", flags = fmtflags(0), precision = 36
> # CLAUSE: lib.locale.num.put
> # LINE: 1854
> # ASSERTION (S7) (4 lines):
> # TEXT: line 377: num_put<wchar_t>::put (..., long double = 1e+4932) wrote L"inf", expected { "1", '0' <repeats 34 times>, "1", '0' <repeats 4897 times> }, flags = fixed, precision = 0
> # CLAUSE: lib.locale.num.put
> # LINE: 1958
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC | ACTIVE | TOTAL | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO | 96 | 96 | 0% |
> # | (S2) NOTE | 1 | 1 | 0% |
> # | (S5) WARNING | 2 | 2 | 0% |
> # | (S7) ASSERTION | 4 | 1671 | 99% |
> # +-----------------------+----------+----------+----------+
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.