This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/7652] -Wswitch-break : Warn if a switch case falls through


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

--- Comment #44 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
FYI, I have got a candidate patch, but the trouble comes with code such as

  case 1:
    if (x) 
      bar (); // warn here
    else
      {   
        bar (); 
        return;
      }   
  case 0:

so this is going to require more thinking & tinkering.  :/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]