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

std::char_traits<char>::find fails to find characters from the extended ASCII set

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.0
    • Component/s: 21. Strings
    • Labels:
      None
    • Environment:

      Description

      The following program asserts:

      $ cat t.cpp
      #include <string>
      #include <assert.h>

      int
      main ()
      {
      assert (std::char_traits< char >::find ("a\201", 2, '\201'));
      return 0;
      }

      $ make t && ./t
      gcc -c -I/build/nicoara/stdcxx/include/ansi -D_RWSTDDEBUG -I/build/nicoara/stdcxx/include -I/build/nicoara/stdcxx/build/include -I/build/nicoara/stdcxx/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align /build/nicoara/stdcxx/examples/manual/t.cpp
      gcc t.o -o t -L/build/nicoara/stdcxx/build/lib -lstd11s -lsupc++ -lm
      t: /build/nicoara/stdcxx/examples/manual/t.cpp:7: int main(): Assertion `std::char_traits< char >::find ("a\201", 2, '\201')' failed.
      Aborted

      possibly because of the way memchr is used in include/rw/_traits.h:409

      Thanks,
      Liviu

        Attachments

          Activity

            People

            • Assignee:
              lnicoara Liviu Nicoara
              Reporter:
              lnicoara Liviu Nicoara
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: