This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
nested functions
- To: gcc-bugs at gcc dot gnu dot org
- Subject: nested functions
- From: Piers O'Hanlon <P dot OHanlon at cs dot ucl dot ac dot uk>
- Date: Fri, 03 Dec 1999 18:32:33 +0000
- cc: P dot OHanlon at cs dot ucl dot ac dot uk
I was wondering if anyone had any idea about this problem with nested C
functions - the docs seem to say they're supported but when I've been trying
to configure/compile libobjects-0.1.19 for Objective C the nested objects test
(below) program core dumps at line 13:
doit(nested);
- it's not clear why.
Any help would be appreciated.
Piers O'Hanlon
--------------________________________________________________________
Computer Science Department Phone: +44 (0) 20 7679 3670
University College London Fax: +44 (0) 20 7387 1397
Gower Street Email: P.OHanlon@cs.ucl.ac.uk
London WC1E 6BT WWW: http://www.cs.ucl.ac.uk/staff/piers
=====================-
config/config.nested.c
----------------------
/* Used by `configure' to test GCC nested functions */
int main()
{
int a = 2;
void nested(int b)
{
a += b;
}
void doit(void(*f)(int))
{
(*f)(4);
}
doit(nested);
if (a != 6)
exit(-1);
exit(0);
}