This is the mail archive of the
mailing list for the GCC project.
Re: style convention: /*foo_p=*/ to annotate bool arguments
- From: <Paul dot Koning at dell dot com>
- To: <msebor at gmail dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 4 Oct 2016 15:41:14 +0000
- Subject: Re: style convention: /*foo_p=*/ to annotate bool arguments
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
> On Oct 3, 2016, at 7:48 PM, Martin Sebor <email@example.com> 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 can't fathom why this makes any sense at all. Bool is just another data type. And on top of that, "true" is obviously a value of type bool. I can't imagine any reason why calls should have funny comments in them that appear only for arguments of that particular type.
Now if you were to propose that all parameters regardless of types should be annotated like this, at least the idea would be consistent. Also amazingly ugly.
It strikes that this is an attempt to make up for the syntactic deficiencies of C/C++. But comments are a poor tool for that, as Lint showed decades ago.