https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85725
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- That's right: unless otherwise specified, string functions require as arguments valid strings, or as the C++ standard defines them, NTBS (nul-terminated byte string). Thus the only valid string that can be stored in char[1] is the empty string. The memchr function must be used to find the first occurrence of a character in an arbitrary (not necesarily nul-terminated) sequence of bytes.