Prototypes

Henry Spencer henry at zoo.toronto.edu
Sun Jul 8 09:58:50 AEST 1990


In article <55550 at lanl.gov> rdw2030 at venus.tamu.edu writes:
>... I've never understood why they exist!  Programs run without them!
>My question... why prototypes? ...

They make it possible for the compiler to do type checking that formerly
had to be done by the programmer or lint (both error-prone, the former
because of human frailty and the latter because too many people either
don't have it or won't use it).

They also give the compiler more information about how functions are
called, which permits optimized calling sequences of various kinds.
Notably, it is no longer necessary for the compiler to assume that
any function might be a varargs function, so non-varargs calls need
not be constrained by the tricky requirements of varargs.  Also of
note for the numerical community is the ability to pass floats as
floats and not have them widened to double, which can be costly.
-- 
"Either NFS must be scrapped or NFS    | Henry Spencer at U of Toronto Zoology
must be changed."  -John K. Ousterhout |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list