From: Jan Kratochvil Date: Fri, 13 Jan 2012 14:31:55 +0000 (+0000) Subject: gdb/doc/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ee339bc478ec8c35f4fee8998456bc33be0a3e2;p=binutils-gdb.git gdb/doc/ * gdbint.texinfo (Coding Standards): Require braces for two lines of code. --- diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 2914190f9fe..8ef5340586b 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2012-01-13 Jan Kratochvil + Eli Zaretskii + + * gdbint.texinfo (Coding Standards): Require braces for two lines of + code. + 2012-01-11 Paul Hilfinger * gdb.texinfo (Variables): Document use of :: for non-static diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 136f77f0e2f..026dc599f9c 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -5849,6 +5849,26 @@ the following guidelines: @tab (pointer dereference) @end multitable +Any two or more lines in code should be wrapped in braces, even if +they are comments, as they look like separate statements: + +@smallexample +if (i) + @{ + /* Return success. */ + return 0; + @} +@end smallexample + +@noindent +and not: + +@smallexample +if (i) + /* Return success. */ + return 0; +@end smallexample + @subsection Comments @cindex comment formatting