Skip to content

Commit

Permalink
[3.10] GH-102711: Fix warnings found by clang (GH-102712) (#103076)
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)

Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
Co-authored-by: Chenxi Mao <chenxi.mao@suse.com>
  • Loading branch information
miss-islington and Chenxi Mao committed Mar 28, 2023
1 parent d445147 commit aae84a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
@@ -0,0 +1 @@
Fix ``-Wstrict-prototypes`` compiler warnings.
4 changes: 2 additions & 2 deletions Parser/pegen.c
Expand Up @@ -809,15 +809,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 aae84a0

Please sign in to comment.