Bug #9145

libast: this statement may fall through

Added by Toomas Soome 12 months ago. Updated 9 months ago.

Status:ClosedStart date:2018-02-20
Priority:NormalDue date:
Assignee:Toomas Soome% Done:

100%

Category:lib - userland libraries
Target version:-
Difficulty:Medium Tags:

Description

Issue found by gcc 7 build:

    ../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

History

#1 Updated by Electric Monk 9 months ago

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

git commit 5c16836ed07979c9ee681cb8eff401a0caacbc7e

commit  5c16836ed07979c9ee681cb8eff401a0caacbc7e
Author: Toomas Soome <tsoome@me.com>
Date:   2018-05-30T14:28:48.000Z

    9145 libast: this statement may fall through
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom