This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[doc patch] gdbint: braces for two lines in code [Re: [patch] Fix for PR gdb/9538 (loading of separate debuginfo and symlinks).]
On Fri, 13 Jan 2012 00:28:35 +0100, Doug Evans wrote:
> I think we should make the braces required.
OK to check in?
Thanks,
Jan
gdb/doc/
2012-01-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdbint.texinfo (Coding Standards): Require braces for two lines of
code.
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -5849,6 +5849,26 @@ the following guidelines:
@tab (pointer dereference)
@end multitable
+Any two lines in code should be wrapped in braces as they look as 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