Skip to content

Add missing <stdbool.h> include to time.h (backport #423) - #425

Merged
mjcarroll merged 1 commit into
lyricalfrom
mergify/bp/lyrical/pr-423
Aug 6, 2026
Merged

Add missing <stdbool.h> include to time.h (backport #423)#425
mjcarroll merged 1 commit into
lyricalfrom
mergify/bp/lyrical/pr-423

Conversation

@mergify

@mergify mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown

rmw/include/rmw/time.h uses bool as the return type of rmw_time_equal() (line 60) but does not include <stdbool.h>. This previously worked because rcutils/time.h transitively pulled in <stdbool.h> via rcutils/types.hhash_map.hallocator.h.

After ros2/rcutils#580 (commit 47a44cb, backported to jazzy as #583) narrowed the include in rcutils/time.h from rcutils/types.h to rcutils/types/rcutils_ret.h, this transitive chain is broken. Any C translation unit that includes rmw/time.h now fails to compile:

  rmw/include/rmw/time.h:60:1: error: unknown type name 'bool'
     60 | bool
        | ^~~~

The fix is to add #include <stdbool.h> to rmw/time.h.

Verification

  /* C translation unit that includes rmw/time.h */
  #include "rmw/time.h"

  void test_func(void) {
      rmw_time_t a = {0, 0};
      rmw_time_t b = {0, 0};
      bool result = rmw_time_equal(a, b);
      (void)result;
  }
  • Create a minimal colcon workspace with rcutils:jazzy and rmw:jazzy (unfixed) and the above C file in a test C package
  • colcon build in the workspace reproduced the above error
  • Changing the rmw package to include the fix in this MR allowed the build to succeed.

Did you use Generative AI?

Claude Opus 4.6


This is an automatic backport of pull request #423 done by Mergify.

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>
(cherry picked from commit 5f21342)
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Author

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mjcarroll
mjcarroll merged commit 6ee0218 into lyrical Aug 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants