This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/10455: typeof(fn) can be used to declare a variable of type function
- From: dgay at acm dot org
- To: gcc-gnats at gcc dot gnu dot org
- Date: 22 Apr 2003 17:49:45 -0000
- Subject: c/10455: typeof(fn) can be used to declare a variable of type function
- Reply-to: dgay at acm dot org
>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 at acm dot 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: