This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][PATCH 1/4][BZ 17083] getaddrinfo: Add comments for #else and #endif directives
- From: Andreas Schwab <schwab at suse dot de>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: DJ Delorie <dj at redhat dot com>, <stlman at poczta dot fm>, <libc-alpha at sourceware dot org>
- Date: Tue, 12 Sep 2017 16:41:12 +0200
- Subject: Re: [RFC][PATCH 1/4][BZ 17083] getaddrinfo: Add comments for #else and #endif directives
- Authentication-results: sourceware.org; auth=none
- References: <xny3plattl.fsf@greed.delorie.com> <alpine.DEB.2.20.1709121429570.28643@digraph.polyomino.org.uk>
On Sep 12 2017, Joseph Myers <joseph@codesourcery.com> wrote:
> On Mon, 11 Sep 2017, DJ Delorie wrote:
>
>> ?ukasz Stelmach <stlman@poczta.fm> writes:
>> > #if __BYTE_ORDER == __BIG_ENDIAN
>> > # define htonl_c(n) n
>> > -#else
>> > +#else /* __BYTE_ORDER == __BIG_ENDIAN */
>> > # define htonl_c(n) __bswap_constant_32 (n)
>> > -#endif
>> > +#endif /* __BYTE_ORDER == __BIG_ENDIAN */
>>
>> What's our policy on inverting the logic sense in these comments when
>> they refer to the #else clause?
>
> I'd expect comments to follow what the GNU Coding Standards say
> ("@samp{#else} should have a comment describing the condition @emph{and
> sense} of the code that follows.").
But in this case the comment only clutters the source.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."