Bug 77853 - -Wimplicit-fallthrough: Fall through comment made ineffective by following comment
Summary: -Wimplicit-fallthrough: Fall through comment made ineffective by following co...
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2016-10-04 23:24 UTC by Alan Modra
Modified: 2018-03-29 15:41 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-10-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Modra 2016-10-04 23:24:03 UTC
int
f (int x)
{
  int ret = 0;
  switch (x)
    {
    case 1:
      ret++;
      /* Fall through.  */

      /* Important comment about case 0.  */
    case 0:
      ret++;
    }
  return ret;
}

Noticed when building binutils with current master gcc.
Comment 1 Jakub Jelinek 2016-10-05 07:07:17 UTC
This should be fixed by the first patch in http://gcc.gnu.org/ml/gcc-patches/2016-09/msg02426.html but it hasn't been reviewed.
Comment 2 Alan Modra 2016-10-06 00:08:10 UTC
Sorry, I opened the bug before I saw your patch.  My email queue is getting too large..