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

gh-112301: fix compiler warning about a possible use of an uninitialized variable#112308

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
carsonRadtke wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromcarsonRadtke:cradtke/fix-maybe-uninit-build-warning

Conversation

@carsonRadtke
Copy link
Contributor

@carsonRadtkecarsonRadtke commentedNov 22, 2023
edited by bedevere-appbot
Loading

In#112301,@mdboom posted a proposal for adding some recommended compiler flags.

This PR addresses a single class of warnings (-Wmaybe-uninitialized) that may crop up if we were to switch to the "hardened" build command.

Specific build error:

./Modules/_io/fileio.c:175:9: warning: ‘exc’ may be used uninitialized [-Wmaybe-uninitialized]  175 |         _PyErr_ChainExceptions1(exc);      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~./Modules/_io/fileio.c: In function ‘_io_FileIO_close’:./Modules/_io/fileio.c:160:15: note: ‘exc’ was declared here  160 |     PyObject *exc;

@ghost
Copy link

ghost commentedNov 22, 2023
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@sethmlarson
Copy link
Contributor

Should we be adding the-Wmaybe-uninitialized option to the build in this PR as well? I think that's coming from-Wall but it's unlikely we enable that option in particular?

@mdboom
Copy link
Contributor

Should we be adding the-Wmaybe-uninitialized option to the build in this PR as well? I think that's coming from-Wall but it's unlikely we enable that option in particular?

Alternatively, should we be adding-Werror=maybe-uninitialized which would error if this kind of thing ever crept back in? IMHO, warnings almost always just get ignored. I'm pretty comfortable that this warning is just a bunch of false positives that are hard to fix. On the other hand, we should probably build consensus before adding new error types. (Probably a discussion to have in the general sense over on#112301).

sethmlarson reacted with thumbs up emoji

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

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@carsonRadtke@sethmlarson@mdboom

[8]ページ先頭

©2009-2025 Movatter.jp