Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ns-mx!umaxc.weeg.uiowa.edu!csq031 From: csq031@umaxc.weeg.uiowa.edu Newsgroups: comp.lang.c++ Subject: problem with declarations in G++ Message-ID: <4232@ns-mx.uiowa.edu> Date: 31 Jan 91 03:35:08 GMT Sender: news@ns-mx.uiowa.edu Reply-To: csq031@umaxc.weeg.uiowa.edu () Organization: U of Iowa, Iowa City, IA Lines: 26 // // zortech has no problem // turbo c++ has no problem // why does gcc get so mad at me? // typedef void (*function_pointer)(void); class x { void funky_function1(function_pointer f); // works OK void funky_function(void (*function_parameter)(void)); // should work }; Compiler output: gcc version 1.37.1 d:/djgcc/bin/cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dunix -Di386 -D__unix__ -D__i386__ tst.cc C:\TMP\/ccAA_AAA.cpp GNU CPP version 1.37.1 d:/djgcc/bin/cc1plus C:\TMP\/ccAA_AAA.cpp -quiet -dumpbase tst.cc -version -o C:\TMP\/ccAA_AAA.s GNU C++ version 1.37.1 (based on GCC 1.37) (80386, BSD syntax) compiled by GNU C version 1.37.1. default target switches: -m80387 tst.cc:10: `function_parameter' undeclared, outside of functions tst.cc:10: parse error before `)' -- Kent Williams --- williams@umaxc.weeg.uiowa.edu "'Is this heaven?' --- 'No, this is Iowa'" - from the movie "Field of Dreams" "This isn't heaven, ... this is Cleveland" - Harry Allard, in "The Stupids Die"