This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

nested functions


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]