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++/63558] New: cannot silence "jump to case label" with fpermissive


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

            Bug ID: 63558
           Summary: cannot silence "jump to case label" with fpermissive
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manu at gcc dot gnu.org

extern int abs(int);
static long int n_ants;
enum enum_var_types
 { VAR_NONE, VAR_DELTA, VAR_SWITCH };

static enum enum_var_types option_var_n_ants;
void
adapt_parameters_next_iteration(void)
{
    switch(option_var_n_ants) {

    case VAR_NONE: break;

    case VAR_DELTA:
        int trunc_n_ants = 0;
        n_ants += trunc_n_ants;
        break;
    case VAR_SWITCH:
        break;
      default: break;
    }
}
$ ~/test1/216257/build/gcc/cc1plus -fpermissive adaptation.ii

adaptation.ii:18:10: warning: jump to case label [-fpermissive]
     case VAR_SWITCH:
          ^
adaptation.ii:15:13: error:   crosses initialization of âint trunc_n_antsâ
         int trunc_n_ants = 0;
             ^
adaptation.ii:20:7: warning: jump to case label [-fpermissive]
       default: break;
       ^
adaptation.ii:15:13: error:   crosses initialization of âint trunc_n_antsâ
         int trunc_n_ants = 0;
             ^

The error should be an inform that is conditional on the previous permerror
return value.

(And what's up with the extra spacing before 'crosses'?)

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