This is the mail archive of the
mailing list for the GCC project.
Re: style convention: /*foo_p=*/ to annotate bool arguments
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: Martin Sebor <msebor at gmail dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>, Jason Merrill <jason at redhat dot com>, Aldy Hernandez <aldyh at redhat dot com>
- Date: Tue, 4 Oct 2016 07:35:39 -0500
- Subject: Re: style convention: /*foo_p=*/ to annotate bool arguments
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org>
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
> >along the lines of
> > foo (1, 2, /*bar_p=*/true);
> I like this if there's more than one boolean arg. If there's only one, I'm
It often is more readable and natural to have a separate "foo_bar"
function for "bar_p = true" (inline perhaps) than to use default
arguments, after which all these comment workarounds go away.