public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/10455: typeof(fn) can be used to declare a variable of type function
@ 2003-05-05 16:39 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-05-05 16:39 UTC (permalink / raw)
  To: dgay, gcc-bugs, gcc-prs, nobody

Synopsis: typeof(fn) can be used to declare a variable of type function

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon May  5 16:39:24 2003
State-Changed-Why:
    Not a bug: given a function g, the expression "g" just decays
    to a _pointer to function_.
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10455


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

* c/10455: typeof(fn) can be used to declare a variable of type function
@ 2003-04-22 17:56 dgay
  0 siblings, 0 replies; 2+ messages in thread
From: dgay @ 2003-04-22 17:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10455
>Category:       c
>Synopsis:       typeof(fn) can be used to declare a variable of type function
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 22 17:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     dgay@acm.org
>Release:        avr-gcc-3.3
>Organization:
>Environment:
Linux 2.4.9-13 #1 Tue Oct 30 20:11:04 EST 2001 i686 unknown
>Description:
  void g(void) { }
  typeof(g) x;

can be used to declare a variable of type function, that can be subsequently called (calls the address of the variable, not its content...)

Note that presumably
  typeof(g) *y;
should be accepted...
>How-To-Repeat:
Compile the following source with -S:

void g(void) { }

typeof(g) x;

void f(void) {
  x();
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-05-05 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-05 16:39 c/10455: typeof(fn) can be used to declare a variable of type function bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-04-22 17:56 dgay

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).