public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32122]  New: invalid indirect goto accepted
@ 2007-05-28  7:28 sabre at nondot dot org
  2007-06-10  2:22 ` [Bug c/32122] indirect goto to an integer accepted pinskia at gcc dot gnu dot org
  2007-11-23 17:30 ` sjackman at gmail dot com
  0 siblings, 2 replies; 7+ messages in thread
From: sabre at nondot dot org @ 2007-05-28  7:28 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-28 20:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-32122-4@http.gcc.gnu.org/bugzilla/>
2021-09-17  4:37 ` [Bug c/32122] indirect goto to an integer accepted pinskia at gcc dot gnu.org
2021-09-17  5:19 ` pinskia at gcc dot gnu.org
2021-09-20  4:14 ` pinskia at gcc dot gnu.org
2021-09-28 20:02 ` cvs-commit at gcc dot gnu.org
2021-09-28 20:07 ` pinskia at gcc dot gnu.org
2007-05-28  7:28 [Bug c/32122] New: invalid indirect goto accepted sabre at nondot dot org
2007-06-10  2:22 ` [Bug c/32122] indirect goto to an integer accepted pinskia at gcc dot gnu dot org
2007-11-23 17:30 ` sjackman at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).