8000 GH-102711: Fix warnings found by clang by parheliamm · Pull Request #102712 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-102711: Fix warnings found by clang #102712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
  • Loading branch information
Chenxi Mao committed Mar 15, 2023
commit 2f1e6555d500d3acdfdf12e1a9037ba94c3ca7e3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``-Wstrict-prototypes`` compiler warnings.
4 changes: 2 additions & 2 deletions Parser/pegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ _PyPegen_fill_token(Parser *p)
#define memo_statistics _PyRuntime.parser.memo_statistics

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