tech-userlevel archive

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

Re: rc.d and non daemon servers

Joerg Sonnenberger wrote:
> On Sat, Mar 07, 2009 at 09:20:37AM -0500, James K. Lowden wrote:
> > Alistair Crooks wrote:
> > > Use a static function for usage message
> > 
> > Why care about static in a module with main()?  
> E.g. compiler can fully inline it automatically.

Well, OK, thanks.  At least I understand.  

You both said "to make the current version of gcc behave".  I guess we
could argue, if we were so inclined, about whether that makes for good

The compiler knows perfectly well this is a main module.  It knows its
public symbols aren't going to be linked to.  It can inline things at
will, and there's no use warning about a missing prototype for a function
that *by definition* can't be used anywhere else.  Forcing "static" (or a
prototype) on the programmer serves no one.  

I'm sure the gcc (and, yea, pcc) folks know all this better than I do. 
Perhaps one day the warnings and inlining will be more fine-tuned,
reducing that "static" to what it really is: visual noise.  I guess then
it will be up to grouches like me to go through the world's C code
removing useless keywords.  

Where's my coffee?  Waiter!  


Home | Main Index | Thread Index | Old Index