]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: Solve comparison between signed and unsigned compiler warning.
authorMark Wielaard <mjw@redhat.com>
Tue, 5 Nov 2013 12:37:33 +0000 (13:37 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 5 Nov 2013 12:37:33 +0000 (13:37 +0100)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/readelf.c

index 72f99245306e265c9f3346e8c751f53ad8a027f1..3012bf4347790e0adc6ebcbbb7a8aab303069ce4 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-05  Mark Wielaard  <mjw@redhat.com>
+
+       * readelf.c (print_debug_ranges_section): Cast address to size_t
+       before comparison.
+       (print_debug_loc_section): Likewise.
+
 2013-10-18  Mark Wielaard  <mjw@redhat.com>
 
        * ar.c (main): Correct operation check when instance_specifed is set.
index d1a5b68245bade71535dc0c8c4d9bef1f69a777a..ac2f2b0a275c184812c8c26b1f8b5a769a1dc77e 100644 (file)
@@ -4638,7 +4638,7 @@ print_debug_ranges_section (Dwfl_Module *dwflmod,
                                      offset, &readp, endp))
        continue;
 
-      if (unlikely (data->d_size - offset < address_size * 2))
+      if (unlikely (data->d_size - offset < (size_t) address_size * 2))
        {
          printf (gettext (" [%6tx]  <INVALID DATA>\n"), offset);
          break;
@@ -6554,7 +6554,7 @@ print_debug_loc_section (Dwfl_Module *dwflmod,
                                      &cu, offset, &readp, endp))
        continue;
 
-      if (unlikely (data->d_size - offset < address_size * 2))
+      if (unlikely (data->d_size - offset < (size_t) address_size * 2))
        {
          printf (gettext (" [%6tx]  <INVALID DATA>\n"), offset);
          break;