From aae84a0e849adc7486115b72e082e6896eebc3d5 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 28 Mar 2023 02:27:41 -0700 Subject: [PATCH] [3.10] GH-102711: Fix warnings found by clang (GH-102712) (#103076) 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 Co-authored-by: Chenxi Mao --- .../next/Build/2023-03-15-02-03-39.gh-issue-102711.zTkjts.rst | 1 + Parser/pegen.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2023-03-15-02-03-39.gh-issue-102711.zTkjts.rst 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 00000000000000..51184396877721 --- /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 95c2273e4b42cf..f440db4a1c9e37 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -809,7 +809,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; @@ -817,7 +817,7 @@ _PyPegen_clear_memo_statistics() } PyObject * -_PyPegen_get_memo_statistics() +_PyPegen_get_memo_statistics(void) { PyObject *ret = PyList_New(NSTATISTICS); if (ret == NULL) {