-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second party
Description
#include <wchar.h>
void the_bug()
{
(void)wcschr(123, 0);
(void)wcsrchr(123, 0);
(void)wcsstr(123, 0);
}
C only; the bug does not reproduce in C++, where wchar_t is a keyword. Only specifically wcschr is affected, not even wcsrchr which has identical prototype.
Expected:
<source>:5:18: error: [...] parameter of type 'const wchar_t *' (aka 'const int *') [-Wint-conversion]
<source>:6:19: error: [...] parameter of type 'const wchar_t *' (aka 'const int *') [-Wint-conversion]
<source>:7:18: error: [...] parameter of type 'const wchar_t *' (aka 'const int *') [-Wint-conversion]
Actual:
<source>:5:18: error: [...] parameter of type 'const int *' [-Wint-conversion]
<source>:6:19: error: [...] parameter of type 'const wchar_t *' (aka 'const int *') [-Wint-conversion]
<source>:7:18: error: [...] parameter of type 'const wchar_t *' (aka 'const int *') [-Wint-conversion]
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second party