Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-48

[IRIX] std::wmemcpy() copies only the first character

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.2
    • 4.1.3
    • 21. Strings
    • None
    • IRIX 6.5

    Description

      The program below aborts at runtime when compiled with SGI MIPSpro and run on SGI IRIX 6.5. Note that IRIX doesn't define wmemcpy (the macros _RWSTD_MO_WMEMCPY and _RWSTD_MO_WMEMCPY_IN_LIBC are both defined) so the called function must be ours.

      $ cat t.cpp && nice gmake t -r && LD_LIBRARY_PATH=../lib ./t
      #include <cassert>
      #include <cwchar>

      int main ()
      {
      wchar_t dst [4] =

      { 0, 1, 2, 3 }

      ;
      std::wmemcpy (dst, L"abc", 3);

      assert (L'a' == dst [0]);
      assert (L'b' == dst [1]);
      assert (L'c' == dst [2]);
      assert (L'\3' == dst [3]);
      }

      CC -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_REENTRANT -D_RWSTD_USE_CONFIG -I/build/sebor/mipspro-7.41-15d/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -g -ansiW -woff1429,1460,1521,3150,3333 t.cpp
      CC t.o -o t -LANG:std=off -Wl,-woff,84 -L/build/sebor/mipspro-7.41-15d/lib -lpthread -L/build/sebor/mipspro-7.41-15d/lib -lstd15d -lm
      rm t.o
      Assertion failed: L'b' == dst [1], file t.cpp, line 10, pid B86430
      Abort (core dumped)

      Attachments

        Activity

          People

            sebor Martin Sebor
            sebor Martin Sebor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: