libparistraceroute / libparistraceroute

libparistraceroute is a library written in C dedicated to active network measurements. Some example are also provided, such as paris-ping and the new implementation of paris-traceroute.
GNU Lesser General Public License v3.0
98 stars 31 forks source link

Consider fixing some warnings with GCC 12 while `-Werror` is on by default. #36

Open GreenYun opened 2 years ago

GreenYun commented 2 years ago

When compiling with GCC 12, the following warnings are generated:

algorithms/mda/interface.c:185:44: warning: argument 1 of type 'const mda_interface_t *[2]' with mismatched bound [-Warray-parameter=]
  185 | void mda_link_dump(const mda_interface_t * link[2], bool do_resolv)
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from algorithms/mda/interface.c:1:
algorithms/mda/interface.h:114:45: note: previously declared as 'const mda_interface_t **'
  114 | void mda_link_dump(const mda_interface_t ** link, bool do_resolv);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
whois.c: In function 'whois_query':
whois.c:94:25: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
   94 |     buffer[BUFFER_SIZE] = '\0';
      |     ~~~~~~~~~~~~~~~~~~~~^~~~~~
whois.c:79:12: note: at offset 1000 into destination object 'buffer' of size 1000
   79 |     char   buffer[BUFFER_SIZE];
      |            ^~~~~~
wastu01 commented 11 months ago

me too

wastu01 commented 11 months ago
algorithms/mda/interface.c:185:44: error: argument 1 of type ‘const mda_interface_t *[2]’ with mismatched bound [-Werror=array-parameter=]
  185 | void mda_link_dump(const mda_interface_t * link[2], bool do_resolv)
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from algorithms/mda/interface.c:1:
algorithms/mda/interface.h:114:45: note: previously declared as ‘const mda_interface_t **’
  114 | void mda_link_dump(const mda_interface_t ** link, bool do_resolv);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:826: algorithms/mda/interface.lo] Error 1
make[2]: Leaving directory '/root/git/libparistraceroute/libparistraceroute'
make[1]: *** [Makefile:543: all] Error 2
make[1]: Leaving directory '/root/git/libparistraceroute/libparistraceroute'
make: *** [Makefile:401: all-recursive] Error 1

on Ubuntu-22.04