[libvirt] [PATCH] docs: mention C89 syntax preferences

* docs/hacking.html.in (Code formatting): Document that // comment and declaration-after-statement are discouraged. * HACKING: Regenerate. --- Any comments on the wording chosen here? Should this go in for 0.9.0? HACKING | 6 ++++++ docs/hacking.html.in | 10 ++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/HACKING b/HACKING index b2ceaa7..686328c 100644 --- a/HACKING +++ b/HACKING @@ -127,6 +127,12 @@ Note that sometimes you'll have to post-process that output further, by piping it through "expand -i", since some leading TABs can get through. Usually they're in macro definitions or strings, and should be converted anyhow. +Libvirt requires a C99 compiler for various reasons. However, most of the code +base prefers to stick to C89 syntax unless there is a compelling reason +otherwise. For example, it is preferable to use "/* */" comments rather than +"//". Also, when declaring local variables, the prevailing style has been to +declare them at the beginning of a scope, rather than immediately before use. + Curly braces ============ diff --git a/docs/hacking.html.in b/docs/hacking.html.in index e0484dd..dd8eeb8 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -152,6 +152,16 @@ anyhow. </p> + <p> + Libvirt requires a C99 compiler for various reasons. However, + most of the code base prefers to stick to C89 syntax unless + there is a compelling reason otherwise. For example, it is + preferable to use <code>/* */</code> comments rather + than <code>//</code>. Also, when declaring local variables, the + prevailing style has been to declare them at the beginning of a + scope, rather than immediately before use. + </p> + <h2><a name="curly_braces">Curly braces</a></h2> -- 1.7.4

On Wed, Mar 30, 2011 at 11:27:11 -0600, Eric Blake wrote:
* docs/hacking.html.in (Code formatting): Document that // comment and declaration-after-statement are discouraged. * HACKING: Regenerate. ---
Any comments on the wording chosen here? Should this go in for 0.9.0?
ACK, wording seems fine to me as does the meaning of those words :-) I think it doesn't really matter when this goes in, it's a documentation for developers who should use git and not released tarballs. For that reason it can't cause any regression or any other harm to users so I'd just push it in now. Jirka

On 03/30/2011 01:47 PM, Jiri Denemark wrote:
On Wed, Mar 30, 2011 at 11:27:11 -0600, Eric Blake wrote:
* docs/hacking.html.in (Code formatting): Document that // comment and declaration-after-statement are discouraged. * HACKING: Regenerate. ---
Any comments on the wording chosen here? Should this go in for 0.9.0?
ACK, wording seems fine to me as does the meaning of those words :-)
I think it doesn't really matter when this goes in, it's a documentation for developers who should use git and not released tarballs. For that reason it can't cause any regression or any other harm to users so I'd just push it in now.
Thanks; pushed. This resolves https://www.redhat.com/archives/libvir-list/2011-March/msg01093.html -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Jiri Denemark