Re: [wwwdocs, coding conventions] Mention OVERRIDE/FINAL

2017-02-03 Thread Trevor Saunders
On Fri, Feb 03, 2017 at 09:34:52AM +0100, Gerald Pfeifer wrote:
> On Fri, 14 Oct 2016, David Malcolm wrote:
> > On Fri, 2016-10-14 at 16:27 +0100, Pedro Alves wrote:
> >> 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.
> > 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?
> 
> I noticed this one has neither been rejected nor applied.
> 
> The patch appears fine wearing my wwwdocs maintainer hat, alas I
> do not feel confident approving it (content-wise).

fwiw I can't think of any big downsides, I guess there's slightly more
work ocassionally when you add a new class that inherits from an old one
and slightly more verbosity, but it definitely seems worth it to me.

Trev

> 
> Perhaps something for Jeff (now added) or Bernd?
> 
> Gerald

> 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 -  1.77
> +++ htdocs/codingconventions.html 14 Oct 2016 21:22:44 -
> @@ -902,7 +902,10 @@ Its use with data-carrying classes is mo
>  
>  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
> +OVERRIDE and FINAL macros from
> +include/ansidecl.h to annotate the code for a human reader,
> +and to allow sufficiently modern C++ compilers to detect mistakes.
>  
>  
>  



Re: [wwwdocs, coding conventions] Mention OVERRIDE/FINAL

2017-02-03 Thread Gerald Pfeifer
On Fri, 14 Oct 2016, David Malcolm wrote:
> On Fri, 2016-10-14 at 16:27 +0100, Pedro Alves wrote:
>> 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.
> 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?

I noticed this one has neither been rejected nor applied.

The patch appears fine wearing my wwwdocs maintainer hat, alas I
do not feel confident approving it (content-wise).

Perhaps something for Jeff (now added) or Bernd?

GeraldIndex: 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 -	1.77
+++ htdocs/codingconventions.html	14 Oct 2016 21:22:44 -
@@ -902,7 +902,10 @@ Its use with data-carrying classes is mo
 
 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
+OVERRIDE and FINAL macros from
+include/ansidecl.h to annotate the code for a human reader,
+and to allow sufficiently modern C++ compilers to detect mistakes.
 
 
 


Re: [wwwdocs, coding conventions] Mention OVERRIDE/FINAL

2017-01-22 Thread Gerald Pfeifer
Hi David,

On Fri, 14 Oct 2016, 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.
> 
> OK to commit?

I saw that Pedro agreed, but none of our global reviewers (such as
Bernd) chimed in.

So, while this looks fine from a pure wwwdocs perspective, I did
not feel comfortable approving it without larger concensus.  If
you want to push this, perhaps send a note/request to gcc@ proposing
this?

GeraldIndex: 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 -	1.77
+++ htdocs/codingconventions.html	14 Oct 2016 21:22:44 -
@@ -902,7 +902,10 @@ Its use with data-carrying classes is mo
 
 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
+OVERRIDE and FINAL macros from
+include/ansidecl.h to annotate the code for a human reader,
+and to allow sufficiently modern C++ compilers to detect mistakes.
 
 
 


Re: [wwwdocs, coding conventions] Mention OVERRIDE/FINAL

2016-10-14 Thread Pedro Alves
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



[wwwdocs, coding conventions] Mention OVERRIDE/FINAL

2016-10-14 Thread David Malcolm
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?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 -	1.77
+++ htdocs/codingconventions.html	14 Oct 2016 21:22:44 -
@@ -902,7 +902,10 @@ Its use with data-carrying classes is mo
 
 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
+OVERRIDE and FINAL macros from
+include/ansidecl.h to annotate the code for a human reader,
+and to allow sufficiently modern C++ compilers to detect mistakes.