the-tcpdump-group / libpcap

the LIBpcap interface to various kernel packet capture mechanism
https://www.tcpdump.org/
Other
2.72k stars 854 forks source link

Warnings on Travis CI with REMOTE=enable #662

Closed fxlb closed 6 years ago

fxlb commented 7 years ago

FYI, seen at https://travis-ci.org/the-tcpdump-group/libpcap/jobs/301611841:

./pcap-new.c: In function ‘pcap_findalldevs_ex’:
./pcap-new.c:248:16: warning: ‘dev’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      dev->next = (pcap_if_t *)malloc(sizeof(pcap_if_t));
                ^
./pcap-rpcap.c: In function ‘pcap_findalldevs_ex_remote’:
./pcap-rpcap.c:2437:14: warning: ‘dev’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    dev->next = (pcap_if_t *)malloc(sizeof(pcap_if_t));
              ^
./daemon.c: In function ‘daemon_msg_startcap_req’:
./daemon.c:1756:13: warning: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Wunused-result]
   strerror_r(ret, thread_errbuf, PCAP_ERRBUF_SIZE);
             ^
./daemon.c: In function ‘daemon_thrdatamain’:
./daemon.c:2242:13: warning: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Wunused-result]
   strerror_r(retval, errbuf, PCAP_ERRBUF_SIZE);
             ^
./daemon.c:2249:13: warning: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Wunused-result]
   strerror_r(retval, errbuf, PCAP_ERRBUF_SIZE);
             ^
./rpcapd.c: In function ‘main_passive’:
./rpcapd.c:546:9: warning: declaration of ‘sockmain’ shadows a global declaration [-Wshadow]
  SOCKET sockmain;
         ^
./rpcapd.c:67:15: warning: shadowed declaration is here [-Wshadow]
 static SOCKET sockmain;    //!< keeps the main socket identifier
               ^
infrastation commented 6 years ago

Those warnings are not present anymore in the most recent job log with GCC, CMAKE=no and REMOTE=enable, must have been fixed since then, closing.