On Saturday, July 4, 2020, Harald van Dijk <har...@gigawatt.nl> wrote: > > This is really the same problem as with standard library functions such as strchr(). The function should have a return type of char* if its argument has type char*. The function should have a return type of const char* if its argument has type const char*. The current signature is the only signature that allows all code that should be valid, at the expense of not rejecting code that should be invalid.
Just to give a note: The const-correctness problem could have been avoided if the function API returns an offset (of `size_t` type) rather than the pointer directly. But it may be too late for the standard library to correct this historical mistake.
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox