From: Lennart Poettering Date: Fri, 31 Jul 2015 18:00:07 +0000 (+0200) Subject: CODING_STYLE: say that "for (;;)" is better than "while (1)" X-Git-Tag: v225~135^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cad6982291a0e3cae4b8b1fad140ffd512e2835c;p=thirdparty%2Fsystemd.git CODING_STYLE: say that "for (;;)" is better than "while (1)" --- diff --git a/CODING_STYLE b/CODING_STYLE index dbadfbdb544..a96ddd35980 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -314,3 +314,10 @@ 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 (;;)".