Bug ID: 84180
           Summary: -Wimplicit-fallthrough=2 heuristic fails when
                    condition in the case
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot
          Reporter: Patrick.Schluter at ec dot
  Target Milestone: ---

A case containing a condition recognizes that it may fall through but the
heuristic to suppress the warning doesn't work at level 2. IMO it should.

Simple example to trigger the behaviour

    case OPEN_FILE:
      if( !access(name, F_OK)) {
      /* fallthrough */
    case CREATE_FILE:

The warning is suppressed only at level 1 of the -Wimplicit-fallthrough=

Reply via email to