Skip to content

Commit

Permalink
pythonGH-102711: Fix warnings found by clang (pythonGH-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.

(cherry picked from commit 7703def)

Co-authored-by: Chenxi Mao <chenxi.mao@suse.com>
Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
  • Loading branch information
Chenxi Mao authored and miss-islington committed Mar 28, 2023
1 parent 5ba5ce4 commit 6fc5042
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 @@ -262,15 +262,15 @@ _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;
}
}

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

0 comments on commit 6fc5042

Please sign in to comment.