pointers to functions

Tim W Smith ts at cup.portal.com
Sat Sep 9 19:01:59 AEST 1989


> K & R are quite definite in stating the correct form is (*f)(), but
> apparently even the gods can lie.

The Gods got it right.  The C compiler for the PDP-11/45 under V6 required
(*f)().  f() got an error.

I'm not sure, but I think this allowing of f() came in with PCC.  It was
clearly a bug, which the ANSI committee has chosen to make a feature.

While we are on the subject, try this one:

	(***************f)();

This will also invoke the function on most compilers.  Tell me with a
straight face that this is not a bug.  Does ANSI require this to work?

> If f holds the address of the start of the function, *f really doesn't
> have any meaning.  

It certainly does.  *f means the function that starts at f.

> John Mundt   Teachers' Aide, Inc.  P.O. Box 1666  Highland Park, IL
> john at chinet.chi.il.us



More information about the Comp.lang.c mailing list