posix.cfg: Ensure null pointer input is correctly handled for bcmp().

This commit is contained in:
orbitcowboy 2022-04-20 18:18:38 +02:00
parent 7cbdea9b81
commit d075cba535
1 changed files with 13 additions and 0 deletions

View File

@ -236,6 +236,19 @@ int nullPointer_strncasecmp(char *a, char *b, size_t n)
return strncasecmp(NULL, b, n);
}
int nullPointer_bcmp(const void *a, const void *b, size_t n)
{
// No nullPointer warning shall be shown:
// cppcheck-suppress bcmpCalled
(void) bcmp(a, b, n);
// cppcheck-suppress nullPointer
// cppcheck-suppress bcmpCalled
(void) bcmp(a, NULL, n);
// cppcheck-suppress nullPointer
// cppcheck-suppress bcmpCalled
return bcmp(NULL, b, n);
}
char * nullPointer_stpcpy(char *src, char *dest)
{
// No warning shall be shown: