Hi,

int main() {
goto bug;
switch(0) {
bug: return 0;
}
}

This program doesn't compile with gcc 3.4.3. It gives this error message:
/tmp/ccetXBGt.o(.text+0x1d): In function `main':
: undefined reference to `.L2'

However, this:

int main() {
goto bug;
switch(0) {
bug: return 0;
default: ;
}
}

does compile without a problem.

gcc 2.95.3 and 3.3.4 compile both examples.

I searched to see if anyone else reported this, and only found bug #17078. I
don't know if it's related or just similar. Sorry if I overlooked another bug
report.

-- 
           Summary: gcc doesn't like switch blocks without case/default
                    labels
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fn_x at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to