From 06732e1a7d6c81f1df03ecb24e0786d8ea92b249 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 30 Mar 2011 09:48:51 -0600 Subject: [PATCH] docs: mention C89 syntax preferences * docs/hacking.html.in (Code formatting): Document that // comment and declaration-after-statement are discouraged. * HACKING: Regenerate. --- HACKING | 6 ++++++ docs/hacking.html.in | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/HACKING b/HACKING index b2ceaa7db1..686328c26e 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 e0484dd599..dd8eeb8fc4 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -152,6 +152,16 @@ 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