aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-03-30 09:48:51 -0600
committerEric Blake <eblake@redhat.com>2011-03-30 13:51:22 -0600
commit06732e1a7d6c81f1df03ecb24e0786d8ea92b249 (patch)
treeb101e45af8882a0843fdcf7954ae16e3c550787b /HACKING
parentqemu: Fix media eject with qemu-0.12.* (diff)
downloadlibvirt-06732e1a7d6c81f1df03ecb24e0786d8ea92b249.tar.gz
libvirt-06732e1a7d6c81f1df03ecb24e0786d8ea92b249.tar.bz2
libvirt-06732e1a7d6c81f1df03ecb24e0786d8ea92b249.zip
docs: mention C89 syntax preferences
* docs/hacking.html.in (Code formatting): Document that // comment and declaration-after-statement are discouraged. * HACKING: Regenerate.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING6
1 files changed, 6 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index b2ceaa7db..686328c26 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
============