Skip to content
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

Eliminate warning message and formatten examples code #52

Merged
merged 4 commits into from
Oct 5, 2023

Conversation

takasehideki
Copy link
Member

see each commit message for more details

```
[10/839] Building CXX object CMakeFiles/mros2-mbed.dir/platform/mros2-platform.cpp.obj
In file included from /__w/mros2-mbed/mros2-mbed/mros2/embeddedRTPS/include/rtps/entities/StatefulReader.h:31,
                 from /__w/mros2-mbed/mros2-mbed/mros2/embeddedRTPS/include/rtps/discovery/BuiltInEndpoints.h:28,
                 from /__w/mros2-mbed/mros2-mbed/mros2/embeddedRTPS/include/rtps/discovery/SEDPAgent.h:28,
                 from /__w/mros2-mbed/mros2-mbed/mros2/embeddedRTPS/include/rtps/entities/Participant.h:30,
                 from /__w/mros2-mbed/mros2-mbed/mros2/embeddedRTPS/include/rtps/entities/Domain.h:30,
                 from /__w/mros2-mbed/mros2-mbed/mros2/embeddedRTPS/include/rtps/rtps.h:28,
                 from /__w/mros2-mbed/mros2-mbed/mros2/include/mros2.h:5,
                 from /__w/mros2-mbed/mros2-mbed/platform/mros2-platform.cpp:17:
/__w/mros2-mbed/mros2-mbed/mros2/embeddedRTPS/include/rtps/entities/Reader.h:74:3: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   74 |   const DataSize_t getDataSize() const { return size; }
      |   ^~~~~
/__w/mros2-mbed/mros2-mbed/platform/mros2-platform.cpp: In function 'nsapi_error_t mros2_platform::network_connect()':
/__w/mros2-mbed/mros2-mbed/platform/mros2-platform.cpp:58:24: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'std::array<unsigned char, 4>::value_type*' {aka 'unsigned char*'} [-Wformat=]
   58 |   sscanf(ip_address, "%d.%d.%d.%d", &ipaddr[0], &ipaddr[1], &ipaddr[2], &ipaddr[3]);
      |                       ~^
      |                        |
      |                        int*
      |                       %hhd
/__w/mros2-mbed/mros2-mbed/platform/mros2-platform.cpp:58:27: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'std::array<unsigned char, 4>::value_type*' {aka 'unsigned char*'} [-Wformat=]
   58 |   sscanf(ip_address, "%d.%d.%d.%d", &ipaddr[0], &ipaddr[1], &ipaddr[2], &ipaddr[3]);
      |                          ~^
      |                           |
      |                           int*
      |                          %hhd
/__w/mros2-mbed/mros2-mbed/platform/mros2-platform.cpp:58:30: warning: format '%d' expects argument of type 'int*', but argument 5 has type 'std::array<unsigned char, 4>::value_type*' {aka 'unsigned char*'} [-Wformat=]
   58 |   sscanf(ip_address, "%d.%d.%d.%d", &ipaddr[0], &ipaddr[1], &ipaddr[2], &ipaddr[3]);
      |                             ~^
      |                              |
      |                              int*
      |                             %hhd
/__w/mros2-mbed/mros2-mbed/platform/mros2-platform.cpp:58:33: warning: format '%d' expects argument of type 'int*', but argument 6 has type 'std::array<unsigned char, 4>::value_type*' {aka 'unsigned char*'} [-Wformat=]
   58 |   sscanf(ip_address, "%d.%d.%d.%d", &ipaddr[0], &ipaddr[1], &ipaddr[2], &ipaddr[3]);
      |                                ~^
      |                                 |
      |                                 int*
      |                                %hhd
```
```
/__w/mros2-mbed/mros2-mbed/workspace/pub_camera_image/app.cpp: In member function 'void OV7670::WriteBy(int)':
/__w/mros2-mbed/mros2-mbed/workspace/pub_camera_image/app.cpp:111:22: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
  111 |         tempo=addr>>7-i;
      |                     ~^~
```
…ing message

```
In file included from /__w/mros2-mbed/mros2-mbed/mros2/include/mros2.h:9,
                 from /__w/mros2-mbed/mros2-mbed/workspace/mturtle_teleop/app.cpp:17:
/__w/mros2-mbed/mros2-mbed/workspace/mturtle_teleop/app.cpp: In function 'int main()':
/__w/mros2-mbed/mros2-mbed/workspace/mturtle_teleop/app.cpp:116:18: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  116 |       MROS2_INFO("");
      |                  ^~
/__w/mros2-mbed/mros2-mbed/mros2/include/mros2/logging.h:46:12: note: in definition of macro 'MROS2_INFO'
   46 |     printf(__VA_ARGS__); \
      |            ^~~~~~~~~~~
/__w/mros2-mbed/mros2-mbed/workspace/mturtle_teleop/app.cpp:88:10: warning: variable 'fds' set but not used [-Wunused-but-set-variable]
   88 |   pollfh fds[1];
      |          ^~~
/__w/mros2-mbed/mros2-mbed/workspace/mturtle_teleop/app.cpp:95:8: warning: unused variable 'c' [-Wunused-variable]
   95 |   char c;
      |        ^
```
result ^= current[i];
result = crc32_for_byte(result);
}


return ~result;
}

const char long_text[] =
#include "long_text.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こんなんできるのか.確かにプリプロセスで展開してるだけですもんね.

@takasehideki takasehideki merged commit b9ed581 into main Oct 5, 2023
18 checks passed
@takasehideki takasehideki deleted the eliminate_warning branch October 5, 2023 09:14
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