James Youngman wrote: > > How many bytes is "the object" large? > > If s is NULL, there _is_ no object. > ... > NULL is not a pointer to an object.
This is not what I'm arguing about. Does memchr(ptr,c,0) for ptr != NULL now access ptr[0] or not? If yes, then when ptr is a pointer that points past the end of a read-write memory page and to the beginning of an unreadable memory page (set up like this with mprotect), then memchr(ptr,c,0) will crash without justification. If no, then the fact that memchr(NULL,c,0) now crashes implies the existence of a 'ptr == NULL' test in the implementation of memchr, which slows down the code execution and whose only purpose is to be maximally picky about a standard. In both cases the memchr implementation is deviating from traditional behaviour and provoking crashes for programs that worked fine earlier. This is unreasonable. Bruno _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils