[comp.sys.amiga.tech] Novice question about Lattice C proto incudes.

briang@sdd.hp.com (Brian Gragg) (08/31/90)

Hi,  
  A quick (I hope) novice question.  I just recently got Lattice C and am
  relatively new to C in general.  I found a few mentions about the proto
  inclues in the manual but no mention was made as to why/what their use
  is.  ( at least none I could find )

  Thanks for the help.

  Brian.

-- 
-----------------------------------------------------------------------------
  Brian Gragg    briang@sdd.hp.com   hp-sdd!briang  uunet!ucsd!hp-sdd!briang
-----------------------------------------------------------------------------

Bits_of_Magic@cup.portal.com (09/05/90)

The proto includes do 2 things:

1) Provide library function prototypes, which allow the compiler to do
type checking on parameters, and tell it the type of any returned value.
Prototyping is now considered de rigueur.

2) Provide function specifications so that the compiler can generate a 
direct call to the function with parameters in registers, rather than
having to call an intermediate routine which puts parameters in registers.
If you don't have the appropriate proto include, the intermediate routine
method is used.  The library function call is made to an address which
is an offset from the LibraryBase address returned from an OpenLibrary().
The proto function specications also provide those offsets.

Nicky Robinson
<bits_of_magic@cup.portal.com>