[Bug c/32122] New: invalid indirect goto accepted

sabre at nondot dot org gcc-bugzilla@gcc.gnu.org
Mon May 28 07:28:00 GMT 2007


GCC accepts this:

void foo() { goto *1; }

The "Labels as Values" section of the doc states that indirect gotos take "Any
expression of type void *".  1 is not of type void*.

it looks like gcc accepts anything convertible to a pointer type.  Trying to
jump to a structure yields:
t.c:15: error: cannot convert to a pointer type

-Chris


-- 
           Summary: invalid indirect goto accepted
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sabre at nondot dot org


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



More information about the Gcc-bugs mailing list