This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
nested functions (cont)
- To: gcc-bugs at gcc dot gnu dot org
- Subject: nested functions (cont)
- From: Piers O'Hanlon <P dot OHanlon at cs dot ucl dot ac dot uk>
- Date: Fri, 03 Dec 1999 19:11:57 +0000
- cc: P dot OHanlon at cs dot ucl dot ac dot uk
Hi again,
Sorry last time I omitted to send info on my system: I am running gcc-2.95.2
on a Ultra-30 running Solaris 2.7 (see below). I have also attached the output
from gcc -g -v --save-temps config.nested.c in a tar.gz file. And the core
file when it crashes - it's not that big. (appologies for those email boxes I
block)
Original message:
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.
Thanks,
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);
}
------------------------
scary[97]gcc % gcc -g -v --save-temps config.nested.c
Reading specs from /cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-
sun-solaris2.7/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.9
5.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dsparc -Dsun -Dunix
-D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
-D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -g
-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) config.nested.c
config.nested.i
GNU CPP version 2.95.2 19991024 (release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.9
5.2/../../../../sparc-sun-solaris2.7/include
/cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.9
5.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.9
5.2/../../../../include/g++-3
End of omitted list.
/cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.9
5.2/cc1 config.nested.i -quiet -dumpbase config.nested.c -g -version -o
config.nested.s
GNU C version 2.95.2 19991024 (release) (sparc-sun-solaris2.7) compiled by GNU
C version 2.95.2 19991024 (release).
/usr/ccs/bin/as -V -Qy -s -o config.nested.o config.nested.s
/usr/ccs/bin/as: WorkShop Compilers 5.0 98/12/21
/cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.9
5.2/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /cs/research/mice/starship/commo
n/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crt1.o
/cs/research/mice/starship/common/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.95
.2/crti.o /usr/ccs/lib/values-Xa.o /cs/research/mice/starship/common/solaris/li
b/gcc-lib/sparc-sun-solaris2.7/2.95.2/crtbegin.o -L/cs/research/mice/starship/c
ommon/solaris/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2
-L/cs/research/mice/starship/common/solaris/sparc-sun-solaris2.7/lib
-L/usr/ccs/bin -L/usr/ccs/lib -L/cs/research/mice/starship/common/solaris/lib
config.nested.o -lgcc -lc -lgcc /cs/research/mice/starship/common/solaris/lib/g
cc-lib/sparc-sun-solaris2.7/2.95.2/crtend.o /cs/research/mice/starship/common/s
olaris/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crtn.o
ld: Software Generation Utilities - Solaris/ELF (3.0)
config.nested.tar.gz