Skip to contentSkip to conversation

what does __foo means.

DISCUSSION Bodo Eggert 2 participants 2 messages Dec 7, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · krishna

Hi all,

Can anyone tell me does double underscore before a function mean? In which scenario a programmer must use it.

---http://www.mozilla.org/hacking/portable-cpp.html--- According to the C++ Standard, 17.4.3.1.2 Global Names [lib.global.names], paragraph 1:

Certain sets of names and function signatures are always reserved to the implementation:
Each name that contains a double underscore (__) or begins with an underscore followed by an uppercase letter (2.11) is reserved to the implemenation for any use.
Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.
---

#2 lore raw
Quoted 4 lines · Bodo Eggert

---http://www.mozilla.org/hacking/portable-cpp.html--- According to the C++ Standard, 17.4.3.1.2 Global Names [lib.global.names], paragraph 1:

Quoted 8 lines

Certain sets of names and function signatures are always reserved to the implementation:
Each name that contains a double underscore (__) or begins with an underscore followed by an uppercase letter (2.11) is reserved to the implemenation for any use.
Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.
---

The Linux kernel, however, _is_ "the implementation", at least in kernel space. Aside from a very few libgcc functions, almost all symbols are available to kernel developers, though not all are necessarily a good idea. :-D

Cheers,
Kyle Moffett

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$ L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+ PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r !y?(-) ------END GEEK CODE BLOCK------