Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!plx!dlb!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c++ Subject: func ptr bug Message-ID: <182@goofy.megatest.UUCP> Date: 24 Dec 87 01:07:21 GMT Organization: Megatest Corporation, San Jose, Ca Lines: 28 Keywords: bug /* I have found a bug in the ATT C++ compiler, release 1.2.1. There is a getaround. Point of order: Who do I report bugs to? I have the sources, so if I fix a bug, how can I submit the fix for inclusion in subsequent releases? Now then, without further ado, heeeere's the BUG! You can't declare a pointer to a function inside a function. It says, "syntax error". The getaround is to use a typedef. */ typedef int (*fptr)(char*); struct foozle { int (*foo)(char*); }; // okay int (*foo)(char*); // okay main() { fptr foozle; // okay int (*foo)(char*); // syntax error {int (*foo)(char*);} // syntax error }