GH-102711: Fix warnings found by clang (#102712)

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.

Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
This commit is contained in:
Chenxi Mao 2023-03-28 16:52:22 +08:00 committed by GitHub
parent f4ed2c6ae5
commit 7703def37e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1 @@
Fix ``-Wstrict-prototypes`` compiler warnings.

View file

@ -250,7 +250,7 @@ _PyPegen_fill_token(Parser *p)
#define memo_statistics _PyRuntime.parser.memo_statistics
void
_PyPegen_clear_memo_statistics()
_PyPegen_clear_memo_statistics(void)
{
for (int i = 0; i < NSTATISTICS; i++) {
memo_statistics[i] = 0;
@ -258,7 +258,7 @@ _PyPegen_clear_memo_statistics()
}
PyObject *
_PyPegen_get_memo_statistics()
_PyPegen_get_memo_statistics(void)
{
PyObject *ret = PyList_New(NSTATISTICS);
if (ret == NULL) {