AT&T C compilers

Daniel E. Platt platt at ndla.UUCP
Sun Feb 26 14:04:04 AEST 1989


In article <569 at marob.MASA.COM>, samperi at marob.MASA.COM (Dominick Samperi) writes:
> The AT&T C compiler (from System V, Release 2?) chokes on a declaration
> of the form:
> 
> extern int bob(double (*)()) ;
> 
> On the other hand, it is accepted by Microsoft C and other C compilers.
> The AT&T C++ translator also chokes on this. Is this declaration 
> incorrect, or have I been bitten by a compiler bug?


The declaration you made corresponds to the ANSI standard, where arguement
type checking is legal.  In the K&R standard, as well as in C++, type checking
of this kind is NOT standard.  You haven't found a bug, just a problem with the
various standards that are now floating around.

What you need to do is to declare

	extern int bob();

and you need to make sure that the type passed and received are the same (very
sure, or it won't work!!!).

Hope this helps!

Dan Platt



More information about the Comp.lang.c mailing list