[PATCH v2] gas: sframe: use standard min/max integer constants
Jens Remus
jremus@linux.ibm.com
Tue Jan 13 12:25:25 GMT 2026
On 1/13/2026 11:03 AM, Indu Bhagat wrote:
> On 1/9/26 3:26 AM, Jens Remus wrote:
>> Replace the use of custom VALUE_{8|16|32|64}BIT constant definitions
>> with the standard INT{8|16|32|64}_{MIN|MAX} ones from stdint.h.
>>
>> Besides improving readability this also fixes the issue that the
>> smallest representable signed 8/16/32-bit integer value was
>> erroneously sized as the next larger integer type. For example
>> get_offset_size_in_bytes (INT8_MIN) returned 2 instead of 1, due
>> to INT8_MIN (= -128) != -VALUE_8BIT (= -127):
>>
>> (gdb) call get_offset_size_in_bytes (-127)
>> $1 = 1
>> (gdb) call get_offset_size_in_bytes (-128)
>> $2 = 2
>>
>> gas/
>> * gen-sframe.c (VALUE_8BIT, VALUE_16BIT, VALUE_32BIT,
>> VALUE_64BIT): Remove.
>> (get_offset_size_in_bytes): Use standard min/max integer
>> constants.
>>
>> Signed-off-by: Jens Remus <jremus@linux.ibm.com>
>
> LGTM.
Thank you for the review! Committed to mainline.
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/
More information about the Binutils
mailing list