This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] un-nest findidx()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]