Skip to content

Comments

CQ: always include stdbool.h if bool is used in C code#5618

Merged
nilason merged 1 commit intoOSGeo:mainfrom
nilason:fix_bool
May 6, 2025
Merged

CQ: always include stdbool.h if bool is used in C code#5618
nilason merged 1 commit intoOSGeo:mainfrom
nilason:fix_bool

Conversation

@nilason
Copy link
Contributor

@nilason nilason commented May 6, 2025

Always #include <stdbool.h> where bool is used.

For the same reason, revert (part of 1e0c11f) definition of TRUE and FALSE (in gis.h) to 1 and 0, in order to avoid the inclusion everywhere it may/should have been needed. In addition, starting with C23 bool is not an int, but a type of its own, making it not interchangeable with int.

Fixes #5585

Always `#include <stdbool.h>` where `bool` is used.

For the same reason, revert (part of 1e0c11f)
definition of `TRUE` and `FALSE` (in gis.h) to `1` and `0`, in order to
avoid the inclusion everywhere it may/should have been needed. In addition,
starting with C23 `bool` is not an int, but a type of its own, making it
not interchangeable with int.
@nilason nilason added this to the 8.5.0 milestone May 6, 2025
@github-actions github-actions bot added vector Related to vector data processing raster Related to raster data processing C Related code is in C libraries module general labels May 6, 2025
@nilason nilason changed the title CQ: always include stdbool.h in C code CQ: always include stdbool.h if bool is used in C code May 6, 2025
@neteler neteler added the backport to 8.4 PR needs to be backported to release branch 8.4 label May 6, 2025
@nilason nilason merged commit 89a831d into OSGeo:main May 6, 2025
29 checks passed
@nilason nilason deleted the fix_bool branch May 8, 2025 07:01
@neteler
Copy link
Member

neteler commented May 8, 2025

@nilason shall I backport this? Looks like important to me...

@nilason
Copy link
Contributor Author

nilason commented May 8, 2025

@nilason shall I backport this? Looks like important to me...

Yes, please. It will be needed (as well as #5621).

@echoix
Copy link
Member

echoix commented May 8, 2025

It already had the backport label. But the #5621 is more important: newer OSGeo4W builds will probably not work without when using GCC15, and will definitely not work in CI.

@neteler
Copy link
Member

neteler commented May 8, 2025

It already had the backport label.

Sure, but someone (who?) has to actually do it :-)

nilason added a commit that referenced this pull request Nov 17, 2025
Always `#include <stdbool.h>` where `bool` is used i C code.

For the same reason, revert (part of 1e0c11f)
definition of `TRUE` and `FALSE` (in gis.h) to `1` and `0`, in order to
avoid the inclusion everywhere it may/should have been needed. In addition,
starting with C23 `bool` is not an int, but a type of its own, making it
not interchangeable with int.
@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

C Related code is in C general libraries module raster Related to raster data processing vector Related to vector data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] t.register crash using file option

3 participants