Skip to content

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

Open
mergify[bot] wants to merge 1 commit into
jazzyfrom
mergify/bp/jazzy/pr-423
Open

Add missing <stdbool.h> include to time.h (backport #423)#427
mergify[bot] wants to merge 1 commit into
jazzyfrom
mergify/bp/jazzy/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

@fujitatomoya

Copy link
Copy Markdown
Collaborator

Pulls: #427
Gist: https://gist.githubusercontent.com/fujitatomoya/7b019c354f89bc8fb9af4419ae3d6219/raw/c9977616bdd3d4647d562eb96b01023b8780760b/ros2.repos
BUILD args: --packages-up-to rmw
TEST args: --packages-select rmw
ROS Distro: jazzy
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/20044

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

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