Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixmaybe-uninitialized compiler warning#134207

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
StanFromIreland wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
fromStanFromIreland:fix-warning

Conversation

StanFromIreland
Copy link
Contributor

(Bonus: 3 space indentation :-)

Found in this buildbotlog.

@StanFromIrelandStanFromIreland changed the titleFix compiler warningFixmaybe-uninitialized compiler warningMay 19, 2025
@vstinner
Copy link
Member

vstinner commentedMay 19, 2025
edited
Loading

Found in this buildbotlog.

I don't see uninitializednewargs in warnings.

Python/ceval.c: In function '_PyEvalFramePushAndInit_Ex':Python/ceval.c:1899:38: warning: 'stack_array' may be used uninitialized [-Wmaybe-uninitialized] 1899 |     _PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~ 1900 |         tstate, func, locals,      |         ~~~~~~~~~~~~~~~~~~~~~          1901 |         newargs, nargs, kwnames, previous      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1902 |     );      |     ~                                 Python/ceval.c:1822:1: note: by argument 4 of type 'const _PyStackRef *' to '_PyEvalFramePushAndInit' declared here 1822 | _PyEvalFramePushAndInit(PyThreadState *tstate, _PyStackRef func,      | ^~~~~~~~~~~~~~~~~~~~~~~Python/ceval.c:1868:17: note: 'stack_array' declared here 1868 |     _PyStackRef stack_array[8];      |                 ^~~~~~~~~~~

@StanFromIreland
Copy link
ContributorAuthor

StanFromIreland commentedMay 19, 2025
edited
Loading

I gathered that the error is because the compiler does not know ifstack_array would ever be used to initialize newargs, and therefore assumed it might remain uninitialized by the time it's passed to_PyEvalFramePushAndInit. Maybe I am wrong?

You can call the buildbot!buildbot Raspbian (Or!buildbot ARM64 Raspbian though that may call all ARM64 buildbots too?) to verify.

chris-eibl reacted with thumbs up emoji

@chris-eibl
Copy link
Member

There is already this issue#132314 and PR#132376 for this false-positive warning.

@StanFromIreland
Copy link
ContributorAuthor

I clicked the Update button accidentally somehow.

@StanFromIreland
Copy link
ContributorAuthor

The pr proposed 2 different approaches, what do you think about this one?

@chris-eibl
Copy link
Member

chris-eibl commentedMay 21, 2025
edited
Loading

I do not think that your approach here can silence themaybe uninitialized warning onstack_array. Which is a false-positive and I still think it should be silenced using adiagnostic pragma, which PR#132376 is already taking care about.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@StanFromIreland@vstinner@chris-eibl

[8]ページ先頭

©2009-2025 Movatter.jp