mirror of
https://github.com/python/cpython.git
synced 2026-06-27 19:36:07 +00:00
gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791)
Change my_strchr() return type to "const char*" (add "const").
Fix the compiler warning:
Modules/_ctypes/_ctypes_test.c: In function 'my_strchr':
Modules/_ctypes/_ctypes_test.c:451:12: warning: return discards
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
451 | return strchr(s, c);
| ^~~~~~
When using C23, strchr(text, ch) return type is "const char*" if text
type is "const char*".
(cherry picked from commit 5465b69255)
This commit is contained in:
parent
5dadc64673
commit
8d32ae75d4
1 changed files with 1 additions and 1 deletions
|
|
@ -446,7 +446,7 @@ EXPORT(char *)my_strtok(char *token, const char *delim)
|
|||
return strtok(token, delim);
|
||||
}
|
||||
|
||||
EXPORT(char *)my_strchr(const char *s, int c)
|
||||
EXPORT(const char *) my_strchr(const char *s, int c)
|
||||
{
|
||||
return strchr(s, c);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue