This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32122] New: invalid indirect goto accepted
- From: "sabre at nondot dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 May 2007 07:28:37 -0000
- Subject: [Bug c/32122] New: invalid indirect goto accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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