incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [jira] Created: (STDCXX-862) [Sun C++ 5.9] 0.char test failed due to different binary representation of "long double ld1 = 0" and "long double ld2 = 0."
Date Mon, 14 Apr 2008 14:54:44 GMT
Farid Zaripov (JIRA) wrote:
> [Sun C++ 5.9] 0.char test failed due to different binary representation of "long double
ld1 = 0" and "long double ld2 = 0."

This feels like compiler bug, wouldn't you say?

Martin

> ---------------------------------------------------------------------------------------------------------------------------
> 
>                  Key: STDCXX-862
>                  URL: https://issues.apache.org/jira/browse/STDCXX-862
>              Project: C++ Standard Library
>           Issue Type: Bug
>           Components: Tests
>     Affects Versions: 4.2.0
>          Environment: Linux
>             Reporter: Farid Zaripov
>             Priority: Trivial
>              Fix For: 4.2.1
> 
> 
> {noformat}
> $ cat test.cpp && CC test.cpp -o test && ./test
> #include <cassert>
> #include <cstring>
> 
> int main ()
> {
>     long double ld1 = 0;
>     long double ld2 = 0.;
>     
>     assert (ld1 == ld2);
>     assert (0 == memcmp (&ld1, &ld2, sizeof (ld1)));
>     
>     return 0;
> }
> test: test.cpp:10: Assertion `0 == memcmp (&ld1, &ld2, sizeof (ld1))' failed.
> Aborted
> {noformat}
> 


Mime
View raw message