Skip to content

Commit 8210ff1

Browse files
Chenxi Maomiss-islington
Chenxi Mao
authored andcommitted
GH-102711: Fix warnings found by clang (GH-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. (cherry picked from commit 7703def) Co-authored-by: Chenxi Mao <chenxi.mao@suse.com> Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
1 parent 5ba5ce4 commit 8210ff1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ``-Wstrict-prototypes`` compiler warnings.

Parser/pegen.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,15 @@ _PyPegen_fill_token(Parser *p)
262262
static long memo_statistics[NSTATISTICS];
263263

264264
void
265-
_PyPegen_clear_memo_statistics()
265+
_PyPegen_clear_memo_statistics(void)
266266
{
267267
for (int i = 0; i < NSTATISTICS; i++) {
268268
memo_statistics[i] = 0;
269269
}
270270
}
271271

272272
PyObject *
273-
_PyPegen_get_memo_statistics()
273+
_PyPegen_get_memo_statistics(void)
274274
{
275275
PyObject *ret = PyList_New(NSTATISTICS);
276276
if (ret == NULL) {

0 commit comments

Comments
 (0)