Skip to content

Commit 2f1e655

Browse files
author
Chenxi Mao
committed
GH-102711: Fix -Wstrict-prototype warnings found by clang
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>
1 parent e94edab commit 2f1e655

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
@@ -250,15 +250,15 @@ _PyPegen_fill_token(Parser *p)
250250
#define memo_statistics _PyRuntime.parser.memo_statistics
251251

252252
void
253-
_PyPegen_clear_memo_statistics()
253+
_PyPegen_clear_memo_statistics(void)
254254
{
255255
for (int i = 0; i < NSTATISTICS; i++) {
256256
memo_statistics[i] = 0;
257257
}
258258
}
259259

260260
PyObject *
261-
_PyPegen_get_memo_statistics()
261+
_PyPegen_get_memo_statistics(void)
262262
{
263263
PyObject *ret = PyList_New(NSTATISTICS);
264264
if (ret == NULL) {

0 commit comments

Comments
 (0)