nested functions

Piers O'Hanlon P.OHanlon@cs.ucl.ac.uk
Fri Dec 3 10:32:00 GMT 1999


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);
}




More information about the Gcc-bugs mailing list