https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93894

            Bug ID: 93894
           Summary: -Wimplicit-fallthrough false warning with operator %
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
  Target Milestone: ---

SVN:r257061 8.0.1 20180125 FAIL
r10-6795 FAIL

$ cat xx.i
int f(int j, int k)
{
    switch (j) {
    case 0:
        switch (k % 2) {
        case 0:
            return 0;
        case 1:
            return 1;
        }
        // return 3; // uncomment to fix warning
    default:
        return 2;
    }
}

$ gcc -fpreprocessed -Wimplicit-fallthrough=2 -O[0123] -c xx.i
xx.i: In function ‘f’:
xx.i:5:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
    5 |  switch (k % 2) {
      |  ^~~~~~
xx.i:12:5: note: here
   12 |     default:
      |     ^~~~~~~

Reply via email to