Message ID | 1476480483.10766.46.camel@redhat.com |
---|---|
State | New |
Headers | show |
On 10/14/2016 10:28 PM, David Malcolm wrote: > I propose that we update our coding conventions to mention the OVERRIDE > and FINAL macros in the paragraph that discusses virtual funcs. > > The attached patch (to the website) does so. > Good idea, I like it. GDB is following GCC's C++ coding conventions, BTW: https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#C.2B-.2B--specific_coding_conventions At least for starters. :-) Let's see how that goes. Thanks, Pedro Alves
Index: htdocs/codingconventions.html =================================================================== RCS file: /cvs/gcc/wwwdocs/htdocs/codingconventions.html,v retrieving revision 1.77 diff -u -p -r1.77 codingconventions.html --- htdocs/codingconventions.html 18 Sep 2016 13:55:17 -0000 1.77 +++ htdocs/codingconventions.html 14 Oct 2016 21:22:44 -0000 @@ -902,7 +902,10 @@ Its use with data-carrying classes is mo <p> Think carefully about the size and performance impact of virtual functions and virtual bases -before using them. +before using them. If you do use virtual functions, use the +<code>OVERRIDE</code> and <code>FINAL</code> macros from +<code>include/ansidecl.h</code> to annotate the code for a human reader, +and to allow sufficiently modern C++ compilers to detect mistakes. </p> <p>