From: Mark Wielaard Date: Tue, 5 Nov 2013 12:37:33 +0000 (+0100) Subject: readelf: Solve comparison between signed and unsigned compiler warning. X-Git-Tag: elfutils-0.158~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be86084bd77f5729138577291baad6b29fb44984;p=thirdparty%2Felfutils.git readelf: Solve comparison between signed and unsigned compiler warning. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 72f992453..3012bf434 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-11-05 Mark Wielaard + + * readelf.c (print_debug_ranges_section): Cast address to size_t + before comparison. + (print_debug_loc_section): Likewise. + 2013-10-18 Mark Wielaard * ar.c (main): Correct operation check when instance_specifed is set. diff --git a/src/readelf.c b/src/readelf.c index d1a5b6824..ac2f2b0a2 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -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] \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] \n"), offset); break;