Skip to content

Comments

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

Merged
echoix merged 1 commit intoOSGeo:mainfrom
nilason:fix_bool_c23_ctypesgen
May 7, 2025
Merged

ctypesgen: Add 'bool' to ctypes type map, needed for C23#5621
echoix merged 1 commit intoOSGeo:mainfrom
nilason:fix_bool_c23_ctypesgen

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
@nilason nilason removed the backport to 8.4 PR needs to be backported to release branch 8.4 label Nov 17, 2025
@nilason nilason modified the milestones: 8.5.0, 8.4.2 Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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