]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
CODING_STYLE: say that "for (;;)" is better than "while (1)" 815/head
authorLennart Poettering <lennart@poettering.net>
Fri, 31 Jul 2015 18:00:07 +0000 (20:00 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 31 Jul 2015 18:00:07 +0000 (20:00 +0200)
CODING_STYLE

index dbadfbdb5441adf3ae53a0ebec458bf2726cd151..a96ddd35980fd11aa2cf81edfee01f77d1f1a496 100644 (file)
   are always defined after more global ones. Thus, our local
   definitions will never "leak" into the global header files, possibly
   altering their effect due to #ifdeffery.
+
+- To implement an endless loop, use "for (;;)" rather than "while
+  (1)". The latter is a bit ugly anyway, since you probably really
+  meant "while (true)"... To avoid the discussion what the right
+  always-true expression for an infinite while() loop is our
+  recommendation is to simply write it without any such expression by
+  using "for (;;)".