🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Clifford Beshers Wed, 22 Mar 1989 04:27
Passing function pointers as parameters.
#1775
Author: Clifford Beshers
Date: Wed, 22 Mar 1989 04:27
27 lines
1351 bytes
Pointers to functions are handled inconsistently when used as
function arguments.  We're using a Sun 4 with g++ version 1.34.1


void F( int i, int (*f)(int) )	// This compiles.
{ }
void G( int (*g)(int) )		// This does not.
{ }



g++ -c -v funcbug.cc
g++ version 1.34.1
 /usr/local/gnu/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ funcbug.cc /tmp/cca09295.cpp
GNU CPP version 1.34
 /usr/local/gnu/lib/gcc-c++ /tmp/cca09295.cpp -quiet -dumpbase funcbug.cc -noreg -version -o /tmp/cca09295.s
GNU C++ version 1.34.1 (sparc) compiled by GNU C version 1.34.
funcbug.cc:4: `g' undeclared, outside of functions
funcbug.cc:4: parse error before `)'

Compilation exited abnormally with code 1 at Tue Mar 21 23:19:25
--
-----------------------------------------------
Cliff Beshers
Columbia University Computer Science Department
beshers@cs.columbia.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads