Subject: Re: KNF & using _ or __ as func. name prefix
To: Jaromir Dolecek <dolecek@ics.muni.cz>
From: Chris G. Demetriou <cgd@netbsd.org>
List: current-users
Date: 11/01/1998 12:26:10
Jaromir Dolecek <dolecek@ics.muni.cz> writes:
> there is nothing said in 1.3.2's /usr/share/misc/style, so how they
> are treated. I'd suppose something like:
> 
> 1. _foo is used for something internal to code in question - such
>   as locally used static function
> 2. __foo is something what is never supposed to show up in usr code
> 	(such as __stat13())

No 'normal' user-land code should _ever_ use symbols like those, as
far as I'm aware (even for "something internal to code in question").
The only things that should are e.g. libc and other 'standard-ish'
libraries, and system include files, that need to worry about
namespace protection, symbol versioning, etc.



> Is this OK ? If yes, KNF should be extended so (I can even send-pr it,
> if it's worth it).

It might make sense to do this, but if you do, you should document
exactly when and where symbols like those should be used.


cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.