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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2.0
    • 4.2.0
    • 21. Strings
    • None

    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

            lnicoara Liviu Nicoara
            lnicoara Liviu Nicoara
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: