You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
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?
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: