Skip to content

Commit b78fdf1

Browse files
committed
addr2line.c: suppress warnings
* addr2line.c (fill_lines): check file size overflow only if it is necessary, and suppress a sign-compare warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 75e2a26 commit b78fdf1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addr2line.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,13 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
458458
fprintf(stderr, "lseek: %s\n", strerror(e));
459459
return;
460460
}
461-
if (filesize > SIZE_MAX) {
461+
#if SIZEOF_OFF_T > SIZEOF_SIZE_T
462+
if (filesize > (off_t)SIZE_MAX) {
462463
close(fd);
463464
fprintf(stderr, "Too large file %s\n", binary_filename);
464465
return;
465466
}
467+
#endif
466468
lseek(fd, 0, SEEK_SET);
467469
/* async-signal unsafe */
468470
file = (char *)mmap(NULL, (size_t)filesize, PROT_READ, MAP_SHARED, fd, 0);

0 commit comments

Comments
 (0)