9145 libast: this statement may fall through

Review Request #878 — Created Feb. 20, 2018 and submitted

tsoome
illumos-gate
9145
6f4b2db...
general
../common/sfio/sfvprintf.c: In function 'sfvprintf':
../common/sfio/sfvprintf.c:365:9: error: this statement may fall through [-Werror=implicit-fallthrough=]
    form += 1; /* fall thru for '*' */
    ~~~~~^~~~
../common/sfio/sfvprintf.c:366:3: note: here
   case '*' :
   ^~~~
../common/sfio/sfvprintf.c:670:10: error: this statement may fall through [-Werror=implicit-fallthrough=]
    flags = (flags & ~(SFFMT_TYPES|SFFMT_LDOUBLE)) | SFFMT_LONG;
../common/sfio/sfvprintf.c:671:3: note: here
   case 's':
   ^~~~
../common/sfio/sfvprintf.c:790:10: error: this statement may fall through [-Werror=implicit-fallthrough=]
    flags = (flags & ~(SFFMT_TYPES|SFFMT_LDOUBLE)) | SFFMT_LONG;
../common/sfio/sfvprintf.c:791:3: note: here
   case 'c':
   ^~~~
../common/sfio/sfvprintf.c:916:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
    ssp = "0123456789ABCDEF";
    ~~~~^~~~~~~~~~~~~~~~~~~~
../common/sfio/sfvprintf.c:917:3: note: here
   case 'x':
   ^~~~
../common/sfio/sfvprintf.c:931:10: error: this statement may fall through [-Werror=implicit-fallthrough=]
    flags &= ~(SFFMT_SIGN|SFFMT_BLANK);
    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../common/sfio/sfvprintf.c:932:3: note: here
   case 'd':
   ^~~~

../common/misc/glob.c: In function 'glob_dir':
../common/misc/glob.c:375:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
    if (!(gp->gl_flags & GLOB_AUGMENTED))
       ^
../common/misc/glob.c:377:3: note: here
   case '*':
   ^~~~

../common/misc/magic.c: In function 'cklang':
../common/misc/magic.c:1425:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
     if (b < e && (*b++ & 0xc0) != 0x80)
        ^
../common/misc/magic.c:1427:4: note: here
    case 3:
    ^~~~
../common/misc/magic.c:1428:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
     if (b < e && (*b++ & 0xc0) != 0x80)
        ^
../common/misc/magic.c:1430:4: note: here
    case 2:
    ^~~~
../common/misc/magic.c:1433:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
     n = 1;
     ~~^~~
../common/misc/magic.c:1434:4: note: here
    case 0:
    ^~~~

../common/sfio/sftable.c: In function 'sffmtpos':
../common/sfio/sftable.c:183:14: error: this statement may fall through [-Werror=implicit-fallthrough=]
    else form += 1; /* drop thru below */
         ~~~~~^~~~
../common/sfio/sftable.c:185:3: note: here
   case '*' :
   ^~~~

../common/tm/tmxscan.c: In function 'scan':
../common/tm/tmxscan.c:381:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
     if (d == 'q')
        ^
../common/tm/tmxscan.c:383:4: note: here
    case 'z':
    ^~~~

../common/sfio/sfhdr.h:1137:20: error: this statement may fall through [-Werror=implicit-fallthrough=]

../common/sfio/_sfputm.c:64:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 8 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputm.c:65:3: note: here
   case 7 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputm.c:65:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 7 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputm.c:66:3: note: here
   case 6 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputm.c:66:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 6 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputm.c:67:3: note: here
   case 5 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputm.c:67:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 5 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputm.c:68:3: note: here
   case 4 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputm.c:68:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 4 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputm.c:69:3: note: here
   case 3 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputm.c:69:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 3 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputm.c:70:3: note: here
   case 2 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputm.c:70:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 2 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputm.c:71:3: note: here
   case 1 : *ps++ = *s++;
   ^~~~

../common/sfio/_sfputl.c:68:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 8 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputl.c:69:3: note: here
   case 7 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputl.c:69:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 7 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputl.c:70:3: note: here
   case 6 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputl.c:70:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 6 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputl.c:71:3: note: here
   case 5 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputl.c:71:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 5 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputl.c:72:3: note: here
   case 4 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputl.c:72:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 4 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputl.c:73:3: note: here
   case 3 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputl.c:73:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 3 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputl.c:74:3: note: here
   case 2 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputl.c:74:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 2 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputl.c:75:3: note: here
   case 1 : *ps++ = *s++;
   ^~~~

../common/sfio/_sfputu.c:61:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 8 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputu.c:62:3: note: here
   case 7 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputu.c:62:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 7 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputu.c:63:3: note: here
   case 6 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputu.c:63:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 6 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputu.c:64:3: note: here
   case 5 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputu.c:64:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 5 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputu.c:65:3: note: here
   case 4 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputu.c:65:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 4 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputu.c:66:3: note: here
   case 3 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputu.c:66:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 3 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputu.c:67:3: note: here
   case 2 : *ps++ = *s++;
   ^~~~
../common/sfio/_sfputu.c:67:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   case 2 : *ps++ = *s++;
            ~~~~~~^~~~~~
../common/sfio/_sfputu.c:68:3: note: here
   case 1 : *ps++ = *s++;
   ^~~~
cc1: all warnings being treated as errors


citrus
  1. Ship It!
  2. 
      
hans
  1. I understand that libast is foreign code, which means cleaning it up this way will generate a load of trouble for anyone trying to update it later.

    Do we really want to do this rather than just silencing the errors with a compiler flag?

    1. Yes, I unerstand the temptation, but I say this - thats the reason why we have version control software (and why we want to have granular commits). Being one actually done such 3-way diff upgrade myself (with mdns), I really do not see too much hassle there.

      Of course the best course of action would be to get the changes upstreamed eventually (I have done that in many cases already).

    2. Fair enough.

  2. 
      
andy_js
  1. Ship It!
  2. 
      
hans
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...