rclc icon indicating copy to clipboard operation
rclc copied to clipboard

Fix string-format type mismatches

Open cliu5764 opened this issue 2 years ago • 9 comments

  Compiler warnings fixes: c files change string formats to match type.

cliu5764 avatar Feb 22 '24 06:02 cliu5764

Thanks for the fix! Btw, your commit message didn't pass the dco check,

To add your Signed-off-by line to every commit in this branch:

Ensure you have a local copy of your branch by [checking out the pull request locally via command line](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally).
In your local branch, run: git rebase HEAD~1 --signoff
Force push your changes to overwrite the branch: git push --force-with-lease origin beechwoods_fixes

Zard-C avatar Feb 22 '24 08:02 Zard-C

@JanStaschulat,Hi Dr Jan, if you have time could you please take a look at this PR? Thanks in advance

Zard-C avatar Feb 22 '24 08:02 Zard-C

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 69.20%. Comparing base (65d293d) to head (c4813b5).

Files Patch % Lines
rclc/src/rclc/timer.c 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##           humble     #400   +/-   ##
=======================================
  Coverage   69.20%   69.20%           
=======================================
  Files          16       16           
  Lines        2715     2715           
  Branches      765      765           
=======================================
  Hits         1879     1879           
  Misses        450      450           
  Partials      386      386           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Feb 28 '24 08:02 codecov-commenter

there is still the compiler warning on OpenRobotics build farm CI job:

format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=] 1836 | "Subscription added to wait_set_subscription[%d]", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1837 | executor->handles[i].index); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | size_t {aka long unsigned int}

https://build.ros2.org/job/Hpr__rclc__ubuntu_jammy_amd64/36/gcc/fileName.-1655778739/

JanStaschulat avatar Mar 05 '24 13:03 JanStaschulat

Here is the warning I see:

/b/mros/installer_no_patches/microros_ws/firmware/mcu_ws/uros/rclc/rclc/src/rclc/executor.c:1836:13: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
 1836 |             "Subscription added to wait_set_subscription[%ld] ",
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1837 |             executor->handles[i].index);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 size_t {aka unsigned int}
/b/mros/installer_no_patches/microros_ws/firmware/mcu_ws/uros/rclc/rclc/src/rclc/executor.c:1836:60: note: format string is defined here
 1836 |             "Subscription added to wait_set_subscription[%ld] ",
      |                                                          ~~^
      |                                                            |
      |                                                            long int
      |                                                          %d

%d work fine on me. maybe I should use %u, what do you think?

cliu5764 avatar Mar 05 '24 20:03 cliu5764

Can someone why the build failed? Thanks

cliu5764 avatar Mar 13 '24 16:03 cliu5764

Can someone why the build failed? Thanks

Check this out https://build.ros2.org/job/Hpr__rclc__ubuntu_jammy_amd64/37/clang-tidy/new/fileName.-1655778739/

Build Status

Zard-C avatar Mar 14 '24 18:03 Zard-C

Can someone why the build failed? Thanks

Check this out https://build.ros2.org/job/Hpr__rclc__ubuntu_jammy_amd64/37/clang-tidy/new/fileName.-1655778739/

Build Status

I checked out the console log, I have no idea why the build got the following errors. Anyone knows?

01:58:54 No credentials specified
01:58:54  > git rev-parse fe02b94aeff734c4e120d3a063c725191ad3c43e^{commit} # timeout=10
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] Can't create fingerprints for some files:
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/timer.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/timer.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:54 [GNU C Compiler (gcc)] [-ERROR-] - '/tmp/ws/src/rclc/rclc/src/rclc/executor.c', IO exception has been thrown: java.nio.file.NoSuchFileException: /tmp/ws/src/rclc/rclc/src/rclc/executor.c
01:58:55 [GNU C Compiler (gcc)] Post processing issues on 'agent-1ec510a6' with source code encoding 'UTF-8'

cliu5764 avatar Mar 15 '24 02:03 cliu5764