[Bug tree-optimization/85725] strchr and strstr of a one-element array with a non-empty string can be assumed to return null

2018-05-11 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85725 --- Comment #3 from Martin Sebor --- 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

[Bug tree-optimization/85725] strchr and strstr of a one-element array with a non-empty string can be assumed to return null

2018-05-11 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85725 --- Comment #2 from Andreas Schwab --- The C standard defines a string as "a contiguous sequence of characters terminated by and including the first null character" (7.1.1).

[Bug tree-optimization/85725] strchr and strstr of a one-element array with a non-empty string can be assumed to return null

2018-05-11 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85725 --- Comment #1 from Richard Biener --- doesn't strchr (a, '1') return a if a[0] == '1'? You seem to read "in the string s" as imposing s to be properly null-terminated. I don't.