Commit 98c036b
authored
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 5465b69)
1 parent cbede46 commit 98c036b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| |||
0 commit comments