diff mbox

[wwwdocs,coding,conventions] Mention OVERRIDE/FINAL

Message ID 1476480483.10766.46.camel@redhat.com
State New
Headers show

Commit Message

David Malcolm Oct. 14, 2016, 9:28 p.m. UTC
On Fri, 2016-10-14 at 16:27 +0100, Pedro Alves wrote:
> On 10/12/2016 03:13 PM, Bernd Schmidt wrote:
> > On 10/12/2016 04:09 PM, Pedro Alves wrote:
> > > 
> > > Thanks.  Here's a follow up patch that I was just testing.
> > > 
> > > Need this if building with "g++ -std=gnu++11", with gcc < 4.7.
> > 
> > Lovely. That's ok too if the other one goes in.
> 
> FYI, I pushed these in now.  I also bootstrapped with the
> jit included in the selected languages, and hacked the
> jit code a bit to trigger the problems OVERRIDE intends to
> catch, just to make sure it still works.
> 
> Thanks,
> Pedro Alves

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.

OK to commit?

Comments

Pedro Alves Oct. 14, 2016, 9:38 p.m. UTC | #1
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
diff mbox

Patch

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>