This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: S390: Fix build failure in test string/tst-endian.c with gcc 6.


On 01/21/2016 02:11 PM, Andreas Schwab wrote:
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.

No it does not work:
tst-endian.c: In function ‘do_test’:
tst-endian.c:17:65: error: self-comparison always evaluates to false [-Werror=tautological-compare]
    if (__BYTE_ORDER == __LITTLE_ENDIAN && htobe16 (be16toh (i)) != i)
                                                                 ^~

cc1: all warnings being treated as errors


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]