nuttx-apps/testing/sensortest
Xiang Xiao fd2289a8a2 testing/sensortest: Fix printf format warning
sensortest.c: In function 'print_valu':
Error: sensortest.c:161:10: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  161 |   printf("%s: timestamp:%" PRIu64 " value:%u\n",
      |          ^~~~~~~~~~~~~~~~~
  162 |          name, event->timestamp, event->ppg);
      |                                  ~~~~~~~~~~
      |                                       |
      |                                       uint32_t {aka long unsigned int}
sensortest.c:161:44: note: format string is defined here
  161 |   printf("%s: timestamp:%" PRIu64 " value:%u\n",
      |                                           ~^
      |                                            |
      |                                            unsigned int
      |                                           %lu
sensortest.c: In function 'print_gps':
Error: sensortest.c:169:10: error: format '%u' expects argument of type 'unsigned int', but argument 15 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  169 |   printf("%s: timestamp:%" PRIu64 " time_utc: %" PRIu64 " latitude: %f "
      |          ^~~~~~~~~~~~~~~~~
......
  175 |          event->ground_speed, event->course, event->satellites_used);
      |                                              ~~~~~~~~~~~~~~~~~~~~~~
      |                                                   |
      |                                                   uint32_t {aka long unsigned int}
sensortest.c:172:13: note: format string is defined here
  172 |          " %u\n", name, event->timestamp, event->time_utc, event->latitude,
      |            ~^
      |             |
      |             unsigned int
      |            %lu
sensortest.c: In function 'print_gps_satellite':
Error: sensortest.c:183:10: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  183 |   printf("%s: timestamp: %" PRIu64 " count: %u satellites: %u", name,
      |          ^~~~~~~~~~~~~~~~~~
  184 |          event->timestamp, event->count, event->satellites);
      |                            ~~~~~~~~~~~~
      |                                 |
      |                                 uint32_t {aka long unsigned int}
sensortest.c:183:46: note: format string is defined here
  183 |   printf("%s: timestamp: %" PRIu64 " count: %u satellites: %u", name,
      |                                             ~^
      |                                              |
      |                                              unsigned int
      |                                             %lu
Error: sensortest.c:183:10: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  183 |   printf("%s: timestamp: %" PRIu64 " count: %u satellites: %u", name,
      |          ^~~~~~~~~~~~~~~~~~
  184 |          event->timestamp, event->count, event->satellites);
      |                                          ~~~~~~~~~~~~~~~~~
      |                                               |
      |                                               uint32_t {aka long unsigned int}
sensortest.c:183:61: note: format string is defined here
  183 |   printf("%s: timestamp: %" PRIu64 " count: %u satellites: %u", name,
      |                                                            ~^
      |                                                             |
      |                                                             unsigned int
      |                                                            %lu

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-19 00:14:59 +08:00
..
Kconfig testing/sensortest: add sensor driver test 2020-10-23 00:43:47 +08:00
Make.defs testing: fix relative path CI error 2021-06-16 09:03:06 -05:00
Makefile testing: fix relative path CI error 2021-06-16 09:03:06 -05:00
sensortest.c testing/sensortest: Fix printf format warning 2021-11-19 00:14:59 +08:00