Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-11 Thread Jeff Law
On 10/11/2016 11:24 AM, Jason Merrill wrote: On Tue, Oct 11, 2016 at 10:54 AM, Martin Sebor wrote: To close the loop on this thread, although there was mild support for both of these conventions there were also objections to both, including a suggestion for an alternative to the "/*foo_p=*/" st

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-11 Thread Jason Merrill
On Tue, Oct 11, 2016 at 10:54 AM, Martin Sebor wrote: > To close the loop on this thread, although there was mild support > for both of these conventions there were also objections to both, > including a suggestion for an alternative to the "/*foo_p=*/" style > that would be preferred by most peop

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-11 Thread Martin Sebor
To close the loop on this thread, although there was mild support for both of these conventions there were also objections to both, including a suggestion for an alternative to the "/*foo_p=*/" style that would be preferred by most people who responded. With that I don't have the sense that there

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-06 Thread David Brown
On 05/10/16 22:24, Florian Weimer wrote: > * David Brown: > >> Far and away the best solution would be for C++ to support named >> parameters or named arguments: >> >> >> >> Then you could write: >> >> foo(1, 2, bar_p: true);

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread Pedro Alves
On 10/05/2016 05:12 PM, Jeff Law wrote: > On 10/04/2016 03:08 PM, Jason Merrill wrote: >> On Tue, Oct 4, 2016 at 4:29 PM, Zan Lynx wrote: >>> On 10/04/2016 02:00 PM, Martin Sebor wrote: This would have been easier if C++ had allowed the same default value to be given in both the dec

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread Pedro Alves
On 10/04/2016 11:41 AM, Jonathan Wakely wrote: > > IMHO even better is to not use bool and define an enumeration type, so > the call site has something unambiguous like foo (1, 2, yes_bar) or > foo (1, 2, no_bar). Whole-heartily agreed. A quite recent example. On gdb-land, a patch was proposing

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread Florian Weimer
* David Brown: > Far and away the best solution would be for C++ to support named > parameters or named arguments: > > > > Then you could write: > > foo(1, 2, bar_p: true); > > You could also write > > foo(y: 2, bar_p:

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread Florian Weimer
* Jeff Law: > On 10/04/2016 03:08 PM, Jason Merrill wrote: >> In GCC sources, I think users look at the function definition more >> often than the declaration in the header, the latter of which >> typically has neither comments nor parameter names. > So true. One could claim that our coding stand

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread Jason Merrill
On Wed, Oct 5, 2016 at 12:18 PM, wrote: >> On Oct 5, 2016, at 12:12 PM, Jeff Law wrote: >> On 10/04/2016 03:08 PM, Jason Merrill wrote: >>> On Tue, Oct 4, 2016 at 4:29 PM, Zan Lynx wrote: >>> ... >>> In GCC sources, I think users look at the function definition more >>> often than the declarati

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread Paul.Koning
> On Oct 5, 2016, at 12:12 PM, Jeff Law wrote: > > On 10/04/2016 03:08 PM, Jason Merrill wrote: >> On Tue, Oct 4, 2016 at 4:29 PM, Zan Lynx wrote: >> ... >> In GCC sources, I think users look at the function definition more >> often than the declaration in the header, the latter of which >> typ

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread Jeff Law
On 10/04/2016 03:08 PM, Jason Merrill wrote: On Tue, Oct 4, 2016 at 4:29 PM, Zan Lynx wrote: On 10/04/2016 02:00 PM, Martin Sebor wrote: This would have been easier if C++ had allowed the same default value to be given in both the declaration and the definition: void foo(int x, int y, bool ba

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-05 Thread David Brown
On 04/10/16 22:00, Martin Sebor wrote: >> This would have been easier if C++ had allowed the same default value to >> be given in both the declaration and the definition: >> >> void foo(int x, int y, bool bar_p = false); >> >> void foo(int x, int y, bool bar_p = false) >> { >> } >> >> It seems stra

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Martin Sebor
On 10/04/2016 04:41 AM, Jonathan Wakely wrote: On 4 October 2016 at 10:21, David Brown wrote: On 04/10/16 01:48, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the C++ front end to annotate arguments in calls to functions taking bool param

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Jason Merrill
On Tue, Oct 4, 2016 at 4:29 PM, Zan Lynx wrote: > On 10/04/2016 02:00 PM, Martin Sebor wrote: >> This would have been easier if C++ had allowed the same default value to >> be given in both the declaration and the definition: >> >> void foo(int x, int y, bool bar_p = false); >> >> void foo(int x,

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Zan Lynx
On 10/04/2016 02:00 PM, Martin Sebor wrote: > This would have been easier if C++ had allowed the same default value to > be given in both the declaration and the definition: > > void foo(int x, int y, bool bar_p = false); > > void foo(int x, int y, bool bar_p = false) > { > } There is really no

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Martin Sebor
This would have been easier if C++ had allowed the same default value to be given in both the declaration and the definition: void foo(int x, int y, bool bar_p = false); void foo(int x, int y, bool bar_p = false) { } It seems strange that this is not allowed. The standard says "A default argum

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Jonathan Wakely
On 4 October 2016 at 16:51, wrote: > >> On Oct 4, 2016, at 11:46 AM, Jonathan Wakely wrote: >> >> On 4 October 2016 at 16:41, wrote: >>> On Oct 3, 2016, at 7:48 PM, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the C

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Paul.Koning
> On Oct 4, 2016, at 11:46 AM, Jonathan Wakely wrote: > > On 4 October 2016 at 16:41, wrote: >> >>> On Oct 3, 2016, at 7:48 PM, Martin Sebor wrote: >>> >>> In a recent review Jason and I discussed the style convention >>> commonly followed in the C++ front end to annotate arguments >>> in c

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Jonathan Wakely
On 4 October 2016 at 16:41, wrote: > >> On Oct 3, 2016, at 7:48 PM, Martin Sebor wrote: >> >> In a recent review Jason and I discussed the style convention >> commonly followed in the C++ front end to annotate arguments >> in calls to functions taking bool parameters with a comment >> along the

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Paul.Koning
> On Oct 3, 2016, at 7:48 PM, Martin Sebor wrote: > > In a recent review Jason and I discussed the style convention > commonly followed in the C++ front end to annotate arguments > in calls to functions taking bool parameters with a comment > along the lines of > > foo (1, 2, /*bar_p=*/true);

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Jeff Law
On 10/04/2016 04:41 AM, Jonathan Wakely wrote: On 4 October 2016 at 10:21, David Brown wrote: On 04/10/16 01:48, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the C++ front end to annotate arguments in calls to functions taking bool param

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Jonathan Wakely
On 4 October 2016 at 12:55, David Brown wrote: > On 04/10/16 12:41, Jonathan Wakely wrote: >> On 4 October 2016 at 10:21, David Brown wrote: >>> On 04/10/16 01:48, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the C++ front end to a

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Nathan Sidwell
On 10/04/16 08:35, Segher Boessenkool wrote: On Tue, Oct 04, 2016 at 07:40:09AM -0400, Nathan Sidwell wrote: On 10/03/16 19:48, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the C++ front end to annotate arguments in calls to functions ta

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Segher Boessenkool
On Tue, Oct 04, 2016 at 07:40:09AM -0400, Nathan Sidwell wrote: > On 10/03/16 19:48, Martin Sebor wrote: > >In a recent review Jason and I discussed the style convention > >commonly followed in the C++ front end to annotate arguments > >in calls to functions taking bool parameters with a comment >

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread David Brown
On 04/10/16 13:40, Nathan Sidwell wrote: > On 10/03/16 19:48, Martin Sebor wrote: >> In a recent review Jason and I discussed the style convention >> commonly followed in the C++ front end to annotate arguments >> in calls to functions taking bool parameters with a comment >> along the lines of >>

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread David Brown
On 04/10/16 12:41, Jonathan Wakely wrote: > On 4 October 2016 at 10:21, David Brown wrote: >> On 04/10/16 01:48, Martin Sebor wrote: >>> In a recent review Jason and I discussed the style convention >>> commonly followed in the C++ front end to annotate arguments >>> in calls to functions taking bo

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Jonathan Wakely
On 4 October 2016 at 12:39, Bernd Schmidt wrote: > On 10/04/2016 12:41 PM, Jonathan Wakely wrote: >> >> On 4 October 2016 at 10:21, David Brown wrote: >>> >>> On 04/10/16 01:48, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Nathan Sidwell
On 10/03/16 19:48, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the C++ front end to annotate arguments in calls to functions taking bool parameters with a comment along the lines of foo (1, 2, /*bar_p=*/true); I like this if there's

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Bernd Schmidt
On 10/04/2016 12:41 PM, Jonathan Wakely wrote: On 4 October 2016 at 10:21, David Brown wrote: On 04/10/16 01:48, Martin Sebor wrote: In a recent review Jason and I discussed the style convention commonly followed in the C++ front end to annotate arguments in calls to functions taking bool param

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread Jonathan Wakely
On 4 October 2016 at 10:21, David Brown wrote: > On 04/10/16 01:48, Martin Sebor wrote: >> In a recent review Jason and I discussed the style convention >> commonly followed in the C++ front end to annotate arguments >> in calls to functions taking bool parameters with a comment >> along the lines

Re: style convention: /*foo_p=*/ to annotate bool arguments

2016-10-04 Thread David Brown
On 04/10/16 01:48, Martin Sebor wrote: > In a recent review Jason and I discussed the style convention > commonly followed in the C++ front end to annotate arguments > in calls to functions taking bool parameters with a comment > along the lines of > > foo (1, 2, /*bar_p=*/true); > > I pointed

style convention: /*foo_p=*/ to annotate bool arguments

2016-10-03 Thread Martin Sebor
In a recent review Jason and I discussed the style convention commonly followed in the C++ front end to annotate arguments in calls to functions taking bool parameters with a comment along the lines of foo (1, 2, /*bar_p=*/true); I pointed out to Jason that in another code review, Jeff asked t