Skip to content

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

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

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 :-)

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 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