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++/28031] [4.2 regression] bogus jump to case label crosses initialization error with C99 anonymous initializers



------- Comment #6 from mmitchel at gcc dot gnu dot org  2008-10-02 14:30 -------
You're getting an error because your code is invalid for the reason the error
message states.  The reason is that if the value of "i" is 1, you will end up
in the "case 1" part with "j" uninitialized.  You can put the entire body of
the outer "case 0" inside braces, so that "j" is not in scope in the "case 1"
part; that will eliminate the error.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28031


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