This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: S390: Fix build failure in test string/tst-endian.c with gcc 6.
- From: Andreas Schwab <schwab at suse dot de>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 21 Jan 2016 14:11:53 +0100
- Subject: Re: S390: Fix build failure in test string/tst-endian.c with gcc 6.
- Authentication-results: sourceware.org; auth=none
- References: <n7qj1p$1em$1 at ger dot gmane dot org>
Stefan Liebler <stli@linux.vnet.ibm.com> writes:
> diff --git a/string/tst-endian.c b/string/tst-endian.c
> index 8684bb2..d093587 100644
> --- a/string/tst-endian.c
> +++ b/string/tst-endian.c
> @@ -13,12 +13,14 @@ do_test (void)
> {
> if (i < UINT64_C (65536))
> {
> +#if __BYTE_ORDER == __LITTLE_ENDIAN
> if (htobe16 (be16toh (i)) != i)
> {
> printf ("htobe16 (be16toh (%" PRIx64 ")) == %" PRIx16 "\n",
> i, (uint16_t) htobe16 (be16toh (i)));
> result = 1;
> }
> +#endif
Does that also work when using if (__BYTE_ORDER == __LITTLE_ENDIAN)?
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."