stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (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 Tue, 15 Apr 2008 20:50:21 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589228#action_12589228
] 

Martin Sebor commented on STDCXX-862:
-------------------------------------

FWIW, I can only reproduce the abort with my installation of Sun C++ when I enable optimization:

{noformat}
$    cat /etc/redhat-release && cat /proc/cpuinfo | grep -m1 "model name" \
  && cat u.cpp && CC -V u.cpp && ./a.out && echo PASS \
  && CC -V -O u.cpp && ./a.out && echo PASS
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
model name      : Intel(R) Xeon(R) CPU           E5345  @ 2.33GHz
#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;
}
CC: Sun C++ 5.9 Linux_i386 2007/05/03
GNU ld version 051128 20051128
  Supported emulations:
   elf_x86_64
   elf_i386
   i386linux
ccfe: Sun C++ 5.9 Linux_i386 2007/05/03
PASS
CC: Sun C++ 5.9 Linux_i386 2007/05/03
ir2hf: Sun Compiler Common 12 Linux_i386 2007/05/03
ube: Sun Compiler Common 12 Linux_i386 2007/05/03
GNU ld version 051128 20051128
  Supported emulations:
   elf_x86_64
   elf_i386
   i386linux
/amd/packages/mdx/redhat/compilers/sun/5.9/prod/bin/c++filt: Sun C++ 5.9 Linux_i386 2007/05/03
ccfe: Sun C++ 5.9 Linux_i386 2007/05/03
iropt: Sun Compiler Common 12 Linux_i386 2007/05/03
a.out: u.cpp:10: Assertion `0 == memcmp (&ld1, &ld2, sizeof (ld1))' failed.
Aborted
{noformat}

> [Sun C++ 5.9] 0.char test failed due to different binary representation of "long double
ld1 = 0" and "long double ld2 = 0."
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 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
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>   Original Estimate: 1h
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> {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}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message