]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: sframe: use standard min/max integer constants
authorJens Remus <jremus@linux.ibm.com>
Tue, 13 Jan 2026 12:17:49 +0000 (13:17 +0100)
committerJens Remus <jremus@linux.ibm.com>
Tue, 13 Jan 2026 12:17:49 +0000 (13:17 +0100)
commit58008ed4e6afd77841c653eee60f60d621fa101a
treed6ccaf0d1924f9c8da167f4d93b18a39fe14a095
parent141f3b0ce1a4141ec0bbd19f1c5713999113a7de
gas: sframe: use standard min/max integer constants

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>
gas/gen-sframe.c