On 04/07/17 13:20, Jan Beulich wrote: >>>> On 04.07.17 at 14:12, <julien.gr...@arm.com> wrote: >> When removing if/for/while statements, the code should be reworked to >> remove the { } and the extra indentation. > Yes. > >> This is improving code maintainability and code readability. > For the given example, yes. However, there are (rare) cases where > having such nested blocks actually improves readability, for example > in certain combinations with preprocessor conditionals. Hence I don't > think we should forbid them.
There are also a few specific cases where it is useful to use blocks like that to introduce a new variable, where introducing it at function level scope isn't appropriate. (Alternatively, we could switch from C89 to C99, but that is a separate discussion). I agree that we should discourage the use of blocks like this, but not forbid them outright. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel