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: Łukasz Stelmach <stlman at poczta dot fm>
- To: DJ Delorie <dj at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 12 Sep 2017 08:12:13 +0000
- 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>
Dnia 11 września 2017 22:01:10 CEST, DJ Delorie <dj@redhat.com> napisał(a):
>
>Ł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?
If I were to answer that question (which I am not sure, because I was the first to ask a question and I don't like when people answer my questions with theirs) looking at the results of "git grep", I'd say, it is hard to tell. It appears #else-es' comments contain not-ted conditions, but the syntax is not clear.
Which one would you recommend?
/* Not __BYTE_ORDER == __BIG_ENDIAN */
/* !(__BYTE_ORDER == __BIG_ENDIAN) */
/* __BYTE_ORDER != __BIG_ENDIAN */
--
Łukasz Stelmach z podróży