Re: argument names in function declarations
der Mouse <[email protected]> Tue, 25 Aug 2009 01:02:11 -0400 (EDT)
| Newsgroups | gmane.os.netbsd.devel.general |
|---|---|
| Message-ID | <[email protected]> |
> Does using leading underscores in the names help with the cpp issue? In system headers? It may help a little. Identifiers beginning with a double underscore, or an underscore followed by an uppercase letter, are "always reserved for any use" according to the C spec. This means that the implementation (and system includes count as part of the implementation) can use them any way it finds convenient, including this one. Other identifiers beginning with an underscore are "always reserved for use as identifiers with file scope in both the ordinary and tag name spaces". This use does not have file scope, so as I read it such identifiers are not reserved for these purposes and thus we can't safely use them here. However, taking advantage of this has the potential to render the code uncompilable by other compilers which do not have our lack of magic semantics for the identifiers in question. And I see additional reasons to avoid them: system headers are not, in general, the right place to document call arguments, and, even if you _do_ want to document the arguments there, just a name is at best a memory-jogger, not real documentation. If you want to document them in the header, I say, use comments; that's what they exist for. /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML [email protected] / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B