Project

General

Profile

Bug #9308

mdnsd: this statement may fall through

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2018-03-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

issue found by gcc 7 build:

    uDNS.c:2312:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
             if (!NATChanged) return;
                ^
    uDNS.c:2315:5: note: here
         case regState_NoTarget:
         ^~~~

    DNSCommon.c:1538:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
             len -= dlen;
             ~~~~^~~~~~~
    DNSCommon.c:1542:5: note: here
         default:
         ^~~~~~~
    DNSCommon.c: In function 'mDNS_vsnprintf':
    DNSCommon.c:4187:29: error: this statement may fall through [-Werror=implicit-fallthrough=]
                     F.precision = sizeof(void*) * 2;                // 8 characters on 32-bit; 16 characters on 64-bit
                     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
    DNSCommon.c:4188:13: note: here
                 case 'X':  digits = "0123456789ABCDEF";
                 ^~~~
    DNSCommon.c:4280:19: error: this statement may fall through [-Werror=implicit-fallthrough=]
                     i = mDNS_snprintf(mDNS_VACB, sizeof(mDNS_VACB), "<<UNKNOWN FORMAT CONVERSION CODE %%%c>>", c);
                     ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    DNSCommon.c:4282:13: note: here
                 case '%':  *sbuffer++ = (char)c;
                 ^~~~

    DNSDigest.c:612:19: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 0: l =((unsigned long)(*((c)++)));     \
                       ^
    DNSDigest.c:670:22: note: in expansion of macro 'HOST_p_c2l'
                 l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
                          ^~~~~~~~~~
    DNSDigest.c:613:9: note: here
             case 1: l|=((unsigned long)(*((c)++)))<< 8; \
             ^
    DNSDigest.c:670:22: note: in expansion of macro 'HOST_p_c2l'
                 l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
                          ^~~~~~~~~~
    DNSDigest.c:613:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 1: l|=((unsigned long)(*((c)++)))<< 8; \
                      ^
    DNSDigest.c:670:22: note: in expansion of macro 'HOST_p_c2l'
                 l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
                          ^~~~~~~~~~
    DNSDigest.c:614:9: note: here
             case 2: l|=((unsigned long)(*((c)++)))<<16; \
             ^
    DNSDigest.c:670:22: note: in expansion of macro 'HOST_p_c2l'
                 l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
                          ^~~~~~~~~~
    DNSDigest.c:614:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 2: l|=((unsigned long)(*((c)++)))<<16; \
                      ^
    DNSDigest.c:670:22: note: in expansion of macro 'HOST_p_c2l'
                 l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
                          ^~~~~~~~~~
    DNSDigest.c:615:9: note: here
             case 3: l|=((unsigned long)(*((c)++)))<<24; \
             ^
    DNSDigest.c:670:22: note: in expansion of macro 'HOST_p_c2l'
                 l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
                          ^~~~~~~~~~
    DNSDigest.c:620:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
                 if (--len == 0) break;                                                 \
                    ^
    DNSDigest.c:685:26: note: in expansion of macro 'HOST_p_c2l_p'
                     l=p[sw]; HOST_p_c2l_p(data,l,sc,len); p[sw]=l;
                              ^~~~~~~~~~~~
    DNSDigest.c:621:9: note: here
             case 1: l|=((unsigned long)(*((c)++)))<< 8; \
             ^
    DNSDigest.c:685:26: note: in expansion of macro 'HOST_p_c2l_p'
                     l=p[sw]; HOST_p_c2l_p(data,l,sc,len); p[sw]=l;
                              ^~~~~~~~~~~~
    DNSDigest.c:622:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
                 if (--len == 0) break;                                                 \
                    ^
    DNSDigest.c:685:26: note: in expansion of macro 'HOST_p_c2l_p'
                     l=p[sw]; HOST_p_c2l_p(data,l,sc,len); p[sw]=l;
                              ^~~~~~~~~~~~
    DNSDigest.c:623:9: note: here
             case 2: l|=((unsigned long)(*((c)++)))<<16; \
             ^
    DNSDigest.c:685:26: note: in expansion of macro 'HOST_p_c2l_p'
                     l=p[sw]; HOST_p_c2l_p(data,l,sc,len); p[sw]=l;
                              ^~~~~~~~~~~~
    DNSDigest.c:612:19: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 0: l =((unsigned long)(*((c)++)));     \
                       ^
    DNSDigest.c:693:17: note: in expansion of macro 'HOST_p_c2l'
                     HOST_p_c2l(data,l,sc);
                     ^~~~~~~~~~
    DNSDigest.c:613:9: note: here
             case 1: l|=((unsigned long)(*((c)++)))<< 8; \
             ^
    DNSDigest.c:693:17: note: in expansion of macro 'HOST_p_c2l'
                     HOST_p_c2l(data,l,sc);
                     ^~~~~~~~~~
    DNSDigest.c:613:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 1: l|=((unsigned long)(*((c)++)))<< 8; \
                      ^
    DNSDigest.c:693:17: note: in expansion of macro 'HOST_p_c2l'
                     HOST_p_c2l(data,l,sc);
                     ^~~~~~~~~~
    DNSDigest.c:614:9: note: here
             case 2: l|=((unsigned long)(*((c)++)))<<16; \
             ^
    DNSDigest.c:693:17: note: in expansion of macro 'HOST_p_c2l'
                     HOST_p_c2l(data,l,sc);
                     ^~~~~~~~~~
    DNSDigest.c:614:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 2: l|=((unsigned long)(*((c)++)))<<16; \
                      ^
    DNSDigest.c:693:17: note: in expansion of macro 'HOST_p_c2l'
                     HOST_p_c2l(data,l,sc);
                     ^~~~~~~~~~
    DNSDigest.c:615:9: note: here
             case 3: l|=((unsigned long)(*((c)++)))<<24; \
             ^
    DNSDigest.c:693:17: note: in expansion of macro 'HOST_p_c2l'
                     HOST_p_c2l(data,l,sc);
                     ^~~~~~~~~~
    DNSDigest.c:629:19: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 3: l =((unsigned long)(*(--(c))))<<16; \
                       ^
    DNSDigest.c:701:21: note: in expansion of macro 'HOST_c2l_p'
                         HOST_c2l_p(data,l,ec); p[sw]=l;
                         ^~~~~~~~~~
    DNSDigest.c:630:9: note: here
             case 2: l|=((unsigned long)(*(--(c))))<< 8; \
             ^
    DNSDigest.c:701:21: note: in expansion of macro 'HOST_c2l_p'
                         HOST_c2l_p(data,l,ec); p[sw]=l;
                         ^~~~~~~~~~
    DNSDigest.c:630:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 2: l|=((unsigned long)(*(--(c))))<< 8; \
                      ^
    DNSDigest.c:701:21: note: in expansion of macro 'HOST_c2l_p'
                         HOST_c2l_p(data,l,ec); p[sw]=l;
                         ^~~~~~~~~~
    DNSDigest.c:631:9: note: here
             case 1: l|=((unsigned long)(*(--(c))));     \
             ^
    DNSDigest.c:701:21: note: in expansion of macro 'HOST_c2l_p'
                         HOST_c2l_p(data,l,ec); p[sw]=l;
                         ^~~~~~~~~~
    DNSDigest.c:629:19: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 3: l =((unsigned long)(*(--(c))))<<16; \
                       ^
    DNSDigest.c:755:9: note: in expansion of macro 'HOST_c2l_p'
             HOST_c2l_p(data,l,ec);
             ^~~~~~~~~~
    DNSDigest.c:630:9: note: here
             case 2: l|=((unsigned long)(*(--(c))))<< 8; \
             ^
    DNSDigest.c:755:9: note: in expansion of macro 'HOST_c2l_p'
             HOST_c2l_p(data,l,ec);
             ^~~~~~~~~~
    DNSDigest.c:630:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 2: l|=((unsigned long)(*(--(c))))<< 8; \
                      ^
    DNSDigest.c:755:9: note: in expansion of macro 'HOST_c2l_p'
             HOST_c2l_p(data,l,ec);
             ^~~~~~~~~~
    DNSDigest.c:631:9: note: here
             case 1: l|=((unsigned long)(*(--(c))));     \
             ^
    DNSDigest.c:755:9: note: in expansion of macro 'HOST_c2l_p'
             HOST_c2l_p(data,l,ec);
             ^~~~~~~~~~
    DNSDigest.c: In function 'MD5_Final':
    DNSDigest.c:612:19: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 0: l =((unsigned long)(*((c)++)));     \
                       ^
    DNSDigest.c:812:5: note: in expansion of macro 'HOST_p_c2l'
         HOST_p_c2l(cp,l,j); p[i++]=l; /* i is the next 'undefined word' */
         ^~~~~~~~~~
    DNSDigest.c:613:9: note: here
             case 1: l|=((unsigned long)(*((c)++)))<< 8; \
             ^
    DNSDigest.c:812:5: note: in expansion of macro 'HOST_p_c2l'
         HOST_p_c2l(cp,l,j); p[i++]=l; /* i is the next 'undefined word' */
         ^~~~~~~~~~
    DNSDigest.c:613:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 1: l|=((unsigned long)(*((c)++)))<< 8; \
                      ^
    DNSDigest.c:812:5: note: in expansion of macro 'HOST_p_c2l'
         HOST_p_c2l(cp,l,j); p[i++]=l; /* i is the next 'undefined word' */
         ^~~~~~~~~~
    DNSDigest.c:614:9: note: here
             case 2: l|=((unsigned long)(*((c)++)))<<16; \
             ^
    DNSDigest.c:812:5: note: in expansion of macro 'HOST_p_c2l'
         HOST_p_c2l(cp,l,j); p[i++]=l; /* i is the next 'undefined word' */
         ^~~~~~~~~~
    DNSDigest.c:614:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
             case 2: l|=((unsigned long)(*((c)++)))<<16; \
                      ^
    DNSDigest.c:812:5: note: in expansion of macro 'HOST_p_c2l'
         HOST_p_c2l(cp,l,j); p[i++]=l; /* i is the next 'undefined word' */
         ^~~~~~~~~~
    DNSDigest.c:615:9: note: here
             case 3: l|=((unsigned long)(*((c)++)))<<24; \
             ^
    DNSDigest.c:812:5: note: in expansion of macro 'HOST_p_c2l'
         HOST_p_c2l(cp,l,j); p[i++]=l; /* i is the next 'undefined word' */
         ^~~~~~~~~~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk over 1 year ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit fff695d46af8deb863236b0569e68ea5a9bb6756

commit  fff695d46af8deb863236b0569e68ea5a9bb6756
Author: Toomas Soome <tsoome@me.com>
Date:   2018-04-01T21:48:01.000Z

    9308 mdnsd: this statement may fall through
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF