Skip to content
Commit d54bb9b1 authored by Tulio Magno Quites Machado Filho's avatar Tulio Magno Quites Machado Filho
Browse files

Prevent an implicit int promotion in malloc/tst-alloc_buffer.c

According to ISO C11, section 6.5.3.3 "Unary arithmetic operators", the
result of the ~ operator is the bitwise complement of its (promoted)
operand.
This can lead to a comparison of a char with another integer type.

Tested on powerpc, powerpc64 and powerpc64le.

	* malloc/tst-alloc_buffer.c (test_misaligned): Cast to char
	before comparing with another char.
parent d9660db2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment