[Python-checkins] [3.11] GH-102711: Fix warnings found by clang (GH-102712) (#103075)

ambv webhook-mailer at python.org
Tue Mar 28 05:27:39 EDT 2023


https://github.com/python/cpython/commit/abd6e97020e5773ce2136228e31930a6d9e82dc0
commit: abd6e97020e5773ce2136228e31930a6d9e82dc0
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2023-03-28T11:27:30+02:00
summary:

[3.11] GH-102711: Fix warnings found by clang (GH-102712) (#103075)

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 7703def37e4fa7d25c3d23756de8f527daa4e165)

Signed-off-by: Chenxi Mao <chenxi.mao at suse.com>
Co-authored-by: Chenxi Mao <chenxi.mao at suse.com>

files:
A Misc/NEWS.d/next/Build/2023-03-15-02-03-39.gh-issue-102711.zTkjts.rst
M Parser/pegen.c

diff --git a/Misc/NEWS.d/next/Build/2023-03-15-02-03-39.gh-issue-102711.zTkjts.rst b/Misc/NEWS.d/next/Build/2023-03-15-02-03-39.gh-issue-102711.zTkjts.rst
new file mode 100644
index 000000000000..511843968777
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2023-03-15-02-03-39.gh-issue-102711.zTkjts.rst
@@ -0,0 +1 @@
+Fix ``-Wstrict-prototypes`` compiler warnings.
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 556e50a104a9..87b47bacec55 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -262,7 +262,7 @@ _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;
@@ -270,7 +270,7 @@ _PyPegen_clear_memo_statistics()
 }
 
 PyObject *
-_PyPegen_get_memo_statistics()
+_PyPegen_get_memo_statistics(void)
 {
     PyObject *ret = PyList_New(NSTATISTICS);
     if (ret == NULL) {



More information about the Python-checkins mailing list