[RFC][PATCH 1/4][BZ 17083] getaddrinfo: Add comments for #else and #endif directives
Łukasz Stelmach
stlman@poczta.fm
Tue Sep 12 08:13:00 GMT 2017
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
More information about the Libc-alpha
mailing list