]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: adjust a comparison in s_align()
authorJan Beulich <jbeulich@suse.com>
Fri, 16 May 2025 10:32:39 +0000 (12:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 16 May 2025 10:32:39 +0000 (12:32 +0200)
In 344b1e0f5f79 ("gas: range-check 3rd argument of .align et al") I
neglected to consider compilers which warn about signed/unsigned
mismatches in comparisons (which is somewhat odd when the signed value is
already known to be non-negative).

gas/read.c

index 0b817b790a1470dfaa300b8958b93c2e6866712e..a73e814324b4ab1b3af2b512bc65b29535f0bdb3 100644 (file)
@@ -1600,7 +1600,7 @@ s_align (signed int arg, int bytes_p)
          ++input_line_pointer;
          offsetT val = get_absolute_expression ();
          max = val;
-         if (val < 0 || max != val)
+         if (val < 0 || max != (valueT) val)
            {
              as_warn (_("ignoring out of range alignment maximum"));
              max = 0;