Skip to content

ctypesgen: Add 'bool' to ctypes type map, needed for C23 #5621

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
May 7, 2025

Conversation

nilason
Copy link
Contributor

@nilason nilason commented May 7, 2025

This change is needed for C23 support, where _Bool is not necessarily defined by default.

See e.g., GCC:

C23 added bool as the preferred name of the boolean type, but _Bool also remains a standard keyword in the language and is supported as such by GCC with -std=c23.

GCC 15 now defaults to C23.

This patch is submitted upstream (ctypesgen/ctypesgen#225).

This change is needed for C23 support, where _Bool is not necessarily
defined by default.

See e.g., https://gcc.gnu.org/onlinedocs/gcc/Boolean-Type.html:

> C23 added bool as the preferred name of the boolean type, but _Bool
> also remains a standard keyword in the language and is supported as
> such by GCC with -std=c23.

GCC 15 now defaults to C23.
@nilason nilason added this to the 8.5.0 milestone May 7, 2025
@nilason nilason added the backport to 8.4 PR needs to be backported to release branch 8.4 label May 7, 2025
@echoix
Copy link
Member

echoix commented May 7, 2025

Without knowing if you'd apply it here, I copied the change over to my PR #5584 to check if it works correctly. But I'll revert it once CI done.

By searching the logs in the compile step of the Windows build for "Rast_legal_semantic_label", you can know if the test in the gunittest step will fail.

@github-actions github-actions bot added Python Related code is in Python libraries docs markdown Related to markdown, markdown files labels May 7, 2025
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

Works as expected on Windows+msys2 having GCC15 in #5584

@echoix echoix enabled auto-merge (squash) May 7, 2025 11:42
@echoix echoix merged commit 7c7162b into OSGeo:main May 7, 2025
28 checks passed
@nilason nilason deleted the fix_bool_c23_ctypesgen branch May 8, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport to 8.4 PR needs to be backported to release branch 8.4 docs libraries markdown Related to markdown, markdown files Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants