8597553
commit d54bb9b1d3fd25779fba2c403003c5097ba9af73
8597553
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
8597553
Date:   Mon Jun 26 09:55:41 2017 -0300
8597553
8597553
    Prevent an implicit int promotion in malloc/tst-alloc_buffer.c
8597553
    
8597553
    According to ISO C11, section 6.5.3.3 "Unary arithmetic operators", the
8597553
    result of the ~ operator is the bitwise complement of its (promoted)
8597553
    operand.
8597553
    This can lead to a comparison of a char with another integer type.
8597553
    
8597553
    Tested on powerpc, powerpc64 and powerpc64le.
8597553
    
8597553
            * malloc/tst-alloc_buffer.c (test_misaligned): Cast to char
8597553
            before comparing with another char.
8597553
8597553
diff --git a/malloc/tst-alloc_buffer.c b/malloc/tst-alloc_buffer.c
8597553
index 1c143999c70180f7..9b2bd2046a12c0f2 100644
8597553
--- a/malloc/tst-alloc_buffer.c
8597553
+++ b/malloc/tst-alloc_buffer.c
8597553
@@ -429,7 +429,7 @@ test_misaligned (char pad)
8597553
   }
8597553
 
8597553
   /* Verify that padding was not overwritten.  */
8597553
-  TEST_VERIFY (backing[0] == ~pad);
8597553
+  TEST_VERIFY (backing[0] == (char) ~pad);
8597553
   TEST_VERIFY (backing[SIZE + 1] == pad);
8597553
   free (backing);
8597553
 }