Skip to content

Commit

Permalink
pythonGH-102711: Fix warnings found by clang (python#102712)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chenxi Mao committed Mar 28, 2023
1 parent f4ed2c6 commit 7703def
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``-Wstrict-prototypes`` compiler warnings.
4 changes: 2 additions & 2 deletions Parser/pegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ _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;
}
}

PyObject *
_PyPegen_get_memo_statistics()
_PyPegen_get_memo_statistics(void)
{
PyObject *ret = PyList_New(NSTATISTICS);
if (ret == NULL) {
Expand Down

0 comments on commit 7703def

Please sign in to comment.