Răsfoiți Sursa

Silence clang warning

shell.c:242:11: warning: cast from 'char *' to 'struct ifreq *' increases required alignment from 1 to 8 [-Wcast-align]
    ifr = (struct ifreq *) reqp;        /* start examining interface */
          ^~~~~~~~~~~~~~~~~~~~~
Bryan Drewery 13 ani în urmă
părinte
comite
bf83d07e29
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      src/shell.c

+ 1 - 1
src/shell.c

@@ -239,7 +239,7 @@ void check_promisc()
   while (reqp < end_req) { 
     struct ifreq ifreq, *ifr = NULL;
 
-    ifr = (struct ifreq *) reqp;	/* start examining interface */
+    ifr = reinterpret_cast<struct ifreq *>(reqp);	/* start examining interface */
     ifreq = *ifr;
     if (!ioctl(sock, SIOCGIFFLAGS, &ifreq)) {	/* we can read this interface! */
       /* sdprintf("Examing interface: %s", ifr->ifr_name); */