c/10455: typeof(fn) can be used to declare a variable of type function
dgay@acm.org
dgay@acm.org
Tue Apr 22 17:56:00 GMT 2003
>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:
More information about the Gcc-bugs
mailing list