tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: missing-prototypes enabled in bsd.sys.mk



On Sun, May 27, 2018 at 06:40:39PM +0100, Sevan Janiyan 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?
> 
> 
> Sevan

Prototypes are extra-important in netbsd, because we abuse them quite
heavily. In netbsd, instead of symbol versioning, we have a macro to
rename somefunction to netbsd80_somefunction.

Without a declaration, it will refer to the old function instead of the
new.  We have an assembler warning too.

I've seen packages crash at runtime because they didn't include a
header.


Home | Main Index | Thread Index | Old Index