C
CBFalconer
Keith said:.... snip ...Nothing stupid about the warning. If it is external to the file it
should appear in the linking header file for the other module.
Every compilation has to stand on its own.
What is a "linking header file"?
For reference, here's an unmercifully abbreviated version of the
source file in question:
[...]
int func (void);
int main (void)
{
[...]
if (func ())
[...]
}
There is a declaration (but not a definition) for the function "func".
It doesn't matter to the compiler whether this declaration appears in
an included header file, or in the source file itself.
I'm sure we really agree. If there is an external file defining
func, it should have an associated header file, and that should
have been #included. Granted, that isn't enforced, but failure to
do so is pure sloppy. The local prototype, as in your abbreviated
source, is only proper if the function is defined in that file,
because it can't be #included in the actual definition file.
If Jacob really wants to improve C, he could work on enforcing
these second nature conventions. Especially since his users
probably tend to be newbies, who are especially likely to be
bitten.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews