Locale-Sensitive C/C++ String Operation Function
void *rawmemchr(const void *block, int c);
Internationalization (I18n) Function Overview
Often the memchr function is used with the knowledge that the byte c is available in the memory block specified by the parameters. But this means that the size parameter is not really needed and that the tests performed with it at runtime (to check whether the end of the block is reached) are not needed.
The rawmemchr function exists for just this situation which is surprisingly frequent. The interface is similar to memchr except that the size parameter is missing. The function will look beyond the end of the block pointed to by block in case the programmer made an error in assuming that the byte c is present in the block. In this case the result is unspecified. Otherwise the return value is a pointer to the located byte.
I18n Issues
There is no ANSI wide character version of this function. In this case we suggest you you use wcschr with an extremely large number as the size parameter. (For sufficiently large size numbers, memchr and rawmemchr are identical.)
Recommended Replacements*
*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.
Locale-Sensitive C/C++ String Operation Functions
|