]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
docs: mention C89 syntax preferences
authorEric Blake <eblake@redhat.com>
Wed, 30 Mar 2011 15:48:51 +0000 (09:48 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 30 Mar 2011 19:51:22 +0000 (13:51 -0600)
* docs/hacking.html.in (Code formatting): Document that // comment
and declaration-after-statement are discouraged.
* HACKING: Regenerate.

HACKING
docs/hacking.html.in

diff --git a/HACKING b/HACKING
index b2ceaa7db1add5e2953ee1b315a4dc4e1e83ca2c..686328c26e3802e7ed4c24b08c6c1839d0edb31e 100644 (file)
--- 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
 ============
index e0484dd5999e13b62cdad0b75ea06766804e29c1..dd8eeb8fc4a642407c31e904a5d9a309a9923127 100644 (file)
       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>