mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.10] GH-102711: Fix warnings found by clang (GH-102712) (#103076)
There are some warnings if build python via clang:
Parser/pegen.c:812:31: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
_PyPegen_clear_memo_statistics()
^
void
Parser/pegen.c:820:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
_PyPegen_get_memo_statistics()
^
void
Fix it to make clang happy.
(cherry picked from commit 7703def37e)
Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
Co-authored-by: Chenxi Mao <chenxi.mao@suse.com>
This commit is contained in:
parent
d445147dfa
commit
aae84a0e84
2 changed files with 3 additions and 2 deletions
|
|
@ -0,0 +1 @@
|
|||
Fix ``-Wstrict-prototypes`` compiler warnings.
|
||||
|
|
@ -809,7 +809,7 @@ _PyPegen_fill_token(Parser *p)
|
|||
static long memo_statistics[NSTATISTICS];
|
||||
|
||||
void
|
||||
_PyPegen_clear_memo_statistics()
|
||||
_PyPegen_clear_memo_statistics(void)
|
||||
{
|
||||
for (int i = 0; i < NSTATISTICS; i++) {
|
||||
memo_statistics[i] = 0;
|
||||
|
|
@ -817,7 +817,7 @@ _PyPegen_clear_memo_statistics()
|
|||
}
|
||||
|
||||
PyObject *
|
||||
_PyPegen_get_memo_statistics()
|
||||
_PyPegen_get_memo_statistics(void)
|
||||
{
|
||||
PyObject *ret = PyList_New(NSTATISTICS);
|
||||
if (ret == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue