In article <[email protected]>,
Sevan Janiyan <[email protected]> wrote:
>Hello,
>When building Lua modules bsd.sys.mk gets included in bsd.lua.mk. In
>bsd.sys.mk -Wmissing-prototypes is enabled via CFLAGS. This forces the
>declaration of prototypes where it would not be a show stopper if it
>wasn't, for example in this case, a Lua module where the function is not
>called anywhere else or prior to the implementation.
>
>-Wmissing-prototypes was enabled over 20 years ago in r1.9 of
>bsd.sys.mk, is the necessity for enabling this a relic from the
>transition from K&R to ANSI-C or is it still a necessary and useful
>check to have enabled by default?
It is still useful; consider the following example. You have a file that
contains:
int
foo(void)
{
return 1;
}
int
main(void)
{
return foo();
}
This will warn; you either want to make foo() static, or you want to
have a prototype declaration in scope from a header file which means
that the function can be used from outside the file scope.
christos