This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] un-nest findidx()
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- Cc: Will Newton <will dot newton at linaro dot org>, Andreas Schwab <schwab at suse dot de>, Roland McGrath <roland at hack dot frob dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 25 Jul 2014 16:37:54 -0400
- Subject: Re: [PATCH] un-nest findidx()
- Authentication-results: sourceware.org; auth=none
- References: <CAGQ9bdz9V7w+5Wn_j8CSKvweh9GkW0gU5GvB94UCP2Zn-bf8OQ at mail dot gmail dot com> <mvm38ei1wad dot fsf at hawking dot suse dot de> <CAGQ9bdw3dJWHsgxgf22F5HEa09VX8gDKeFN-GQuRm-ymcJMZ-Q at mail dot gmail dot com> <mvmlhsazl00 dot fsf at hawking dot suse dot de> <CAGQ9bdyn6RLeGAHs-OCvWO_=1JRERnW8Xi-0J-dopNPs+-augA at mail dot gmail dot com> <CAGQ9bdy-SnHuNs-PdoUue75am+tgYu2Qw=mUZpMJBhnkyit4Fw at mail dot gmail dot com> <CANu=DmgjjaAoZVe=FiiyjD=C9pbk+FJTDReyY=KdqgSz22m4wg at mail dot gmail dot com> <CAGQ9bdzq+xVnXh=JG9U=jntfh_ghzJfBcSkCB-t0rvUW5kHVhQ at mail dot gmail dot com> <CANu=DmiK07ScVcLSREYs8uqWqp6uXCtKtUj5GR_425+ec3FDhA at mail dot gmail dot com> <53D2A00C dot 1070308 at redhat dot com> <CAGQ9bdx-956RyYCNyCxKGsYacSdP2b+sM7-iGRwS8KP_yWt5ow at mail dot gmail dot com>
On 07/25/2014 03:19 PM, Konstantin Serebryany wrote:
> I certainly don't care which way to choose, but a quick grep shows
> that both styles are frequent:
This isn't quite an apples-to-apples comparison.
For commenting conditionals I think it's overwhelmingly
the case that the closing #endif contains the conditional
that was true for that branch.
The case of conditionals that are file inclusion guards
is unique though, and it turns out I'm wrong here. In this
case the overwhelming majority close out the conditional
with the name of the file. This makes sense since it gives
the most information to the developer that it is (a) an
inclusion guard and (b) which file. The down side being
that if the file is moved you need to update the inclusion
guard comment.
I think both are acceptable and I've commented as such in
the Style and Conventions guide.
https://sourceware.org/glibc/wiki/Style_and_Conventions#Commenting_.23endif
I retract my statement that I'd change your patch.
Cheers,
Carlos.