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



Sevan Janiyan <venture37%geeklan.co.uk@localhost> wrote:

> -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?

This is not only a transition relic.  Imagine a library that defines a
function int foo(int), not used by the library itself, but that
accidentally declares int fooo(int) in its headers.  The compiler
cannot tell anything about the declaration of fooo().  But it can warn
you about the missing prototype for foo().

-uwe



Home | Main Index | Thread Index | Old Index