This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix htonl, htons, ntohl, ntohs functions on big endian systems
- From: Zack Weinberg <zackw at panix dot com>
- To: Aurelien Jarno <aurelien at aurel32 dot net>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sat, 30 Jul 2016 21:55:32 -0400
- Subject: Re: [PATCH] Fix htonl, htons, ntohl, ntohs functions on big endian systems
- Authentication-results: sourceware.org; auth=none
- References: <1469919569-27798-1-git-send-email-aurelien@aurel32.net>
On Sat, Jul 30, 2016 at 6:59 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
>
> This patch attempts to fix that. It adds an implicit cast for ntohl and
> htonl using a GCC extension or an explicit one when not using GCC. It
> adds an explicit cast for ntohs and htons as the call to __bswap_16
> contains an explicit cast.
I support fixing this. However, what is the benefit of the "implicit
cast" construct over the "explicit"? It seems like gratuitous
#ifdeffage at first sight.
zw