tech-userlevel archive

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

Re: rc.d and non daemon servers



In article <20090307122317.0194a7eb.jklowden%schemamania.org@localhost>,
James K. Lowden <tech-userlevel%netbsd.org@localhost> wrote:
>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
>advice.  
>
>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.  

It is not useless. It makes the symbol local and does not pollute the global
namespace.

christos



Home | Main Index | Thread Index | Old Index