提交 06732e1a 编写于 作者: E Eric Blake

docs: mention C89 syntax preferences

* docs/hacking.html.in (Code formatting): Document that // comment
and declaration-after-statement are discouraged.
* HACKING: Regenerate.
上级 e586f574
...@@ -127,6 +127,12 @@ Note that sometimes you'll have to post-process that output further, by piping ...@@ -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 it through "expand -i", since some leading TABs can get through. Usually
they're in macro definitions or strings, and should be converted anyhow. 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 Curly braces
============ ============
......
...@@ -152,6 +152,16 @@ ...@@ -152,6 +152,16 @@
anyhow. anyhow.
</p> </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> <h2><a name="curly_braces">Curly braces</a></h2>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册