Add missing <stdbool.h> include to time.h - #423
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
|
|
|
@wjwwood @ivanpauno Apologies for the direct ping, but any chance one of you may be able to review this PR and provide feedback (I could not figure out a handle for Brandon Ong)? Tagging both of you as documented maintainers of the package. Happy to provide more details or documentation, as necessary. |
fujitatomoya
left a comment
There was a problem hiding this comment.
the fix itself looks good, but we should probably put this into rolling branch and backport downstream branches including jazzy?
The time.h header uses `bool` for the return type of `rmw_time_equal()` but does not directly include `<stdbool.h>`. This was previously provided transitively through `rcutils/time.h` -> `rcutils/types.h`, but ros2/rcutils#580 narrowed that include chain, breaking compilation of downstream C translation units. Signed-off-by: Siddhartha Banerjee <sbanerjee@overland.ai>
c8d8d2c to
bdf9d85
Compare
|
@fujitatomoya Thank you for the review! I have reset my branch to |
|
Hi can you please backport to humble as well. |
|
@banerjs-overland do you think you can sign off the commit so that the DCO checker will pass? |
@mjcarroll I have signed off on the commit. Unfortunately the DCO check is failing on commits further back in the history of this branch |
|
@Mergifyio backport lyrical kilted jazzy humble |
✅ Backports have been createdDetails
|
The time.h header uses `bool` for the return type of `rmw_time_equal()` but does not directly include `<stdbool.h>`. This was previously provided transitively through `rcutils/time.h` -> `rcutils/types.h`, but ros2/rcutils#580 narrowed that include chain, breaking compilation of downstream C translation units. (cherry picked from commit 5f21342) Signed-off-by: Siddhartha Banerjee <sbanerjee@overland.ai> Co-authored-by: banerjs-overland <sbanerjee@overland.ai>
rmw/include/rmw/time.husesboolas the return type ofrmw_time_equal()(line 60) but does not include<stdbool.h>. This previously worked becausercutils/time.htransitively pulled in<stdbool.h>viarcutils/types.h→hash_map.h→allocator.h.After ros2/rcutils#580 (commit 47a44cb, backported to jazzy as #583) narrowed the include in
rcutils/time.hfromrcutils/types.htorcutils/types/rcutils_ret.h, this transitive chain is broken. Any C translation unit that includesrmw/time.hnow fails to compile:The fix is to add #include <stdbool.h> to rmw/time.h.
Verification
rcutils:jazzyandrmw:jazzy(unfixed) and the above C file in a test C packagecolcon buildin the workspace reproduced the above errorDid you use Generative AI?
Claude Opus 4.6