Re: hunt_victim()

From: Ron Poulton (ron@res.com)
Date: 08/16/95


> > This is what is known as 'prototyping'.  What this means is you let a 
> > function or a file know that an external function exists.  Alternately, 
> > you could use:
> 
> > void hunt_victim();
> 
> I believe using the old style declaration hunt_victim() as a prototype in
> spec_procs.c simply to escape warnings is not a good thing. If you screw
> up the call of hunt_victim in spec_procs.c (or whereever it's called, not
> the file in which it's declared) the compiler can not readily check that
> you've passed the correct arguments to hunt_victim since it needs the
> prototype to check (although in my experience, it depends on the compiler;
> gcc seems to catch most of the screw-ups in cckr declarations). 

Yeah, it may provide a problem as far as passing the incorrect parameters 
goes.  I haven't tested this insight, since I didn't actually know about 
it; I assumed the linker would test for things appropriately.  Sounds 
like it's something worth looking into.

Generally, I just make sure I pass the right parameters.  Something to 
note in future expansions, in any case.

> Levork, master of the run-on sentence.. *8)

Took a couple reads to understand what the hell you were saying. >:)



This archive was generated by hypermail 2b30 : 12/18/00 PST