diff --git a/doc/manual/style.txt b/doc/manual/style.txt index b9a7612f0..0fe33876e 100644 --- a/doc/manual/style.txt +++ b/doc/manual/style.txt @@ -106,6 +106,20 @@ int f(int x1, int x2) int y = f(x1, x2 - x1); ... } +@endcode +- Separate assignment and logical test statements. In other words, you +should write statements like the following: +@code +// separate statements should be preferred +result = foo(); +if (ERROR_OK != result) + ... +@endcode +More directly, do @b not combine these kinds of statements: +@code +// Combined statements should be avoided +if (ERROR_OK != (result = foo())) + return result; @endcode */