Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. 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."

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.1
    • Component/s: Tests
    • Labels:
      None
    • Environment:

      Linux

    • Severity:
      Incorrect Behavior

      Description

      $ 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
      

        Attachments

          Activity

            People

            • Assignee:
              farid Farid Zaripov
              Reporter:
              farid Farid Zaripov

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h

                  Issue deployment