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

postpone <stdbool.h> inclusion after Python.h#130641

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

Merged
vstinner merged 1 commit intopython:mainfromchouquette:delay_stdbool_inclusion
Feb 28, 2025

Conversation

@chouquette
Copy link
Contributor

stdbool.h will cause <features.h> to be included before Python.h can define some macros to enable some additional features, causing multiple types not to be defined down the line

In my specific case, this was causing build failures when building python withzig cc

stdbool.h will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line
@ghost
Copy link

ghost commentedFeb 27, 2025
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.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@vstinnervstinner merged commit830f04b intopython:mainFeb 28, 2025
51 checks passed
@vstinnervstinner added the needs backport to 3.13bugs and security fixes labelFeb 28, 2025
@miss-islington-app
Copy link

Thanks@chouquette for the PR, and@vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@chouquette and@vstinner, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 830f04b5056db92ba96387db0a778dcd19a39522 3.13

@bedevere-app
Copy link

GH-130675 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelFeb 28, 2025
vstinner pushed a commit to vstinner/cpython that referenced this pull requestFeb 28, 2025
Remove inclusions prior to Python.h.<stdbool.h> will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line.(cherry picked from commit830f04b)
vstinner added a commit that referenced this pull requestFeb 28, 2025
Postpone <stdbool.h> inclusion after Python.h (#130641)Remove inclusions prior to Python.h.<stdbool.h> will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line.(cherry picked from commit830f04b)Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
@colesbury
Copy link
Contributor

I noticed we still have a bunch of places where we#include <stdbool.h> first. When is this a problem and when is it not?

#include<stdbool.h>
#include"Python.h"

#include<stdbool.h>
#include"Python.h"

#include<stdbool.h>
#include<Python.h>

#include<stdbool.h>
#include"Python.h"

#include<stdbool.h>
#include"Python.h"

#include<stdbool.h>
#include"Python.h"

@chouquette
Copy link
ContributorAuthor

Disclaimer: I don't know the python code base at all

My take on this is that it seemsPython.h is meant to be included as the first header for any source, similar to howconfig.h usually is for most autoconf based projects.
If that's the case, not doing so is likely to break in various "fun" ways depending on the libc implementation, so I'd say there never a good reason not to includePython.h first.
I only patched the errors I encountered but I can open a follow up PR

@vstinner
Copy link
Member

Follow-up: PR#130738.

seehwan pushed a commit to seehwan/cpython that referenced this pull requestApr 16, 2025
Remove inclusions prior to Python.h.<stdbool.h> will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel is a code owner

Assignees

@vstinnervstinner

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@chouquette@colesbury@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp