[openbeos] Re: -Wmissing-prototypes

  • From: "Andrew Bachmann" <shatty@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 30 Dec 2003 20:58:26 -0800 PST

Michael Phipps <mphipps1@xxxxxxxxxxxxxxxx> wrote:
> I think that we need more info. Are these functions that the driver 
> contains? Kernel functions?
> The "proper" way to do this is to put the prototypes in a header file. 
> There are apps out there that can generate header files from C code. In 
> general, keeping warnings is a good thing...

Here's an example:

There's a function called control_hook.  It is defined in a prototype 
prior to its use in device_hooks.  Since control_hook actually
performs a number of different behaviors, depending on the
argument, each was broken out into a separate function, which was
defined before control_hook.  No other functions are going to call
these functions, so there's really no point to define prototypes for
them in the header or anywhere else.

I agree that warnings are a good thing but sometimes they just
don't serve a useful purpose.  We are already going to get the
warning when a function is implicitly defined due to a missing
prototype and I think that's enough.


Other related posts: