lanceberc / ycwx

Weather web pages for yacht clubs and other interested parties
MIT License
1 stars 1 forks source link

Warnings on building sensord #9

Open rkaiser0324 opened 1 year ago

rkaiser0324 commented 1 year ago

Seems to build and run without errors though.

root@f6a7487631fa:/home/stfyc/src# make clean
rm sensord
root@f6a7487631fa:/home/stfyc/src# make
cc -g -O -o sensord sensord.c -lwebsockets -lcjson
In file included from /usr/local/include/libwebsockets.h:365,
                 from sensord.c:15:
sensord.c: In function 'init_tempest':
sensord.c:201:13: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type '__time_t' {aka 'long int'} [-Wformat=]
  201 |   lwsl_user("Initializing history sec %u", tv.tv_sec);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
      |                                              |
      |                                              __time_t {aka long int}
sensord.c:201:40: note: format string is defined here
  201 |   lwsl_user("Initializing history sec %u", tv.tv_sec);
      |                                       ~^
      |                                        |
      |                                        unsigned int
      |                                       %lu
sensord.c: In function 'process_airmar':
sensord.c:110:32: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
  110 | #define AIRMAR_HIST_ENTRY_JSON "{\"sec\": %u, \"speed\": %4.1f, \"gust\": %4.1f, \"dir\": %5.1f},"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sensord.c:110:32: note: in definition of macro 'AIRMAR_HIST_ENTRY_JSON'
  110 | #define AIRMAR_HIST_ENTRY_JSON "{\"sec\": %u, \"speed\": %4.1f, \"gust\": %4.1f, \"dir\": %5.1f},"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sensord.c:110:44: note: format string is defined here
  110 | #define AIRMAR_HIST_ENTRY_JSON "{\"sec\": %u, \"speed\": %4.1f, \"gust\": %4.1f, \"dir\": %5.1f},"
      |                                           ~^
      |                                            |
      |                                            unsigned int
      |                                           %lu
In file included from /usr/local/include/libwebsockets.h:365,
                 from sensord.c:15:
sensord.c: In function 'callback_wind':
sensord.c:792:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
  792 |     lwsl_notice("LWS_CALLBACK_RECEIVE cJSON (len %d) %s\n", len, in);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                             |
      |                                                             size_t {aka long unsigned int}
sensord.c:792:51: note: format string is defined here
  792 |     lwsl_notice("LWS_CALLBACK_RECEIVE cJSON (len %d) %s\n", len, in);
      |                                                  ~^
      |                                                   |
      |                                                   int
      |                                                  %ld
In file included from /usr/local/include/libwebsockets.h:365,
                 from sensord.c:15:
sensord.c:792:17: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'void *' [-Wformat=]
  792 |     lwsl_notice("LWS_CALLBACK_RECEIVE cJSON (len %d) %s\n", len, in);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       ~~
      |                                                                  |
      |                                                                  void *
sensord.c:792:55: note: format string is defined here
  792 |     lwsl_notice("LWS_CALLBACK_RECEIVE cJSON (len %d) %s\n", len, in);
      |                                                      ~^
      |                                                       |
      |                                                       char *
      |                                                      %p
In file included from /usr/local/include/libwebsockets.h:365,
                 from sensord.c:15:
sensord.c:795:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
  795 |       lwsl_err("LWS_CALLBACK_RECEIVE cJSON couldn't parse (len %d) %s\n", len, in);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                                           |
      |                                                                           size_t {aka long unsigned int}
sensord.c:795:65: note: format string is defined here
  795 |       lwsl_err("LWS_CALLBACK_RECEIVE cJSON couldn't parse (len %d) %s\n", len, in);
      |                                                                ~^
      |                                                                 |
      |                                                                 int
      |                                                                %ld
In file included from /usr/local/include/libwebsockets.h:365,
                 from sensord.c:15:
sensord.c:795:16: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'void *' [-Wformat=]
  795 |       lwsl_err("LWS_CALLBACK_RECEIVE cJSON couldn't parse (len %d) %s\n", len, in);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       ~~
      |                                                                                |
      |                                                                                void *
sensord.c:795:69: note: format string is defined here
  795 |       lwsl_err("LWS_CALLBACK_RECEIVE cJSON couldn't parse (len %d) %s\n", len, in);
      |                                                                    ~^
      |                                                                     |
      |                                                                     char *
      |                                                                    %p
In file included from /usr/local/include/libwebsockets.h:365,
                 from sensord.c:15:
sensord.c:867:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
  867 |     lwsl_debug("LWS_CALLBACK_RAW_RX_FILE len %d\n", len);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                     |
      |                                                     size_t {aka long unsigned int}
sensord.c:867:47: note: format string is defined here
  867 |     lwsl_debug("LWS_CALLBACK_RAW_RX_FILE len %d\n", len);
      |                                              ~^
      |                                               |
      |                                               int
      |                                              %ld
root@53bcfa0a046d:/home/stfyc/src# cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
root@53bcfa0a046d:/home/stfyc/src#