Subject: no GCC nested functions on NetBSD/pmax
To: None <bug-gcc@prep.ai.mit.edu, port-pmax@NetBSD.ORG>
From: None <gord@engg.ucalgary.ca>
List: port-pmax
Date: 03/29/1996 18:01:12
Hi!

I'm trying to compile GNU libobjects-0.1.19, and I came across this
error:

b21::~/work/libobjects-0.1.19 --> ./configure
loading cache ./config.cache
checking for gcc... gcc
checking whether we are using GNU C... yes
checking how to run the C preprocessor... gcc -E
checking whether we are using NeXT's compiler... no
checking whether cross-compiling... no
checking whether nested functions work... aborting

The GCC 'nested functions' feature does not seem to be working on
this machine. Libobjects makes extensive use of nested functions.
Read the bug-report instructions in the GCC texinfo manual
and submit a bug report.
The program this configure script used to test nested functions
can be found in the file 'config/config.nested.c' in this
distribution.  Under sparc-sun-sunos4.1.3 with gcc-2.6.1 the
file compiles, runs and returns exit status 0.
b21::~/work/libobjects-0.1.19 --> cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

/var/tmp/cc0130741.o: In function `main':
./config/config.nested.c(.text+0xc8): undefined reference to `cacheflush'
b21::~/work/libobjects-0.1.19 --> cat 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);
}
b21::~/work/libobjects-0.1.19 --> 

Here are some version numbers for you:

b21::~/work/libobjects-0.1.19 --> gcc --verbose
Reading specs from /apps/lib/gcc-lib/mips-dec-netbsd1.1A/2.7.2/specs
gcc version 2.7.2
b21::~/work/libobjects-0.1.19 --> uname -v
NetBSD 1.1A (GENERIC) #1: Mon Jan 10 18:31:24 MST 1994     gord@b21.engg.ucalgary.ca:/usr/src/sys/arch/pmax/compile/GENERIC

I'd appreciate a patch, if you come up with one.

Thanks,

--Gord

-- 
   Gord Matzigkeit    |    This is my NetBSD development account
gord@engg.ucalgary.ca |  Please send mail to gord@enci.ucalgary.ca