This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] un-nest findidx()
- From: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- To: "Carlos O'Donell" <carlos at redhat 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 23:19:35 +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>
I certainly don't care which way to choose, but a quick grep shows
that both styles are frequent:
% grep '#endif.*/\*.*[A-Z]' */*.h
argp/argp-fmtstream.h:#endif /* __OPTIMIZE__ */
argp/argp-fmtstream.h:#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
argp/argp.h:#endif /* Use extern inlines. */
argp/argp-namefrob.h:#endif /* !_LIBC */
assert/assert.h:#endif /* NDEBUG. */
benchtests/bench-string.h:#endif /* TEST_MAIN */
bits/byteswap.h:#endif /* _BITS_BYTESWAP_H */
bits/environments.h:#endif /* __WORDSIZE == 32 */
bits/mathdef.h:#endif /* ISO C99 */
bits/siginfo.h:#endif /* !have siginfo_t && (have _SIGNAL_H || need
siginfo_t). */
bits/siginfo.h:#endif /* have _SIGNAL_H. */
bits/sigset.h:#endif /* ! _SIGSET_H_fns. */
...
248 total
% grep '#endif.*/\*.*\.h' */*.h
argp/argp-fmtstream.h:#endif /* argp-fmtstream.h */
argp/argp.h:#endif /* argp.h */
assert/assert.h:#endif /* assert.h */
b/abi-versions.h:#endif /* abi-versions.h */
bits/atomic.h:#endif /* bits/atomic.h */
bits/ipctypes.h:#endif /* bits/ipctypes.h */
bits/libc-lock.h:#endif /* bits/libc-lock.h */
bits/libc-tsd.h:#endif /* bits/libc-tsd.h */
bits/signum.h:#endif /* <signal.h> included. */
bits/sigthread.h:#endif /* bits/sigthread.h */
bits/sockaddr.h:#endif /* bits/sockaddr.h */
bits/socket.h:#endif /* bits/socket.h */
184 total
--kcc
On Fri, Jul 25, 2014 at 10:21 PM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 07/25/2014 10:29 AM, Will Newton wrote:
>> +#endif /* weight.h */
>>
>> Which I would usually expect to see as something like:
>>
>> #endif /* !_WEIGHT_H_ */
>>
>> But it's a small nit indeed...
>
> I would immediately clean this up to !_WEIGHT_H_ if I saw
> it in code, which means it's a part of our coding style and
> should be adjusted to match existing style.
>
> I like it because it immediately alerts you to the condition
> that started the conditional.
>
> Cheers,
> Carlos.