diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-21 13:32:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-21 13:32:13 +0000 |
commit | b78fdf1a82347a0cc0ffda73cf4c7ef032ff6ea3 (patch) | |
tree | e78c85594ce91102ae6d0602d4f05067645002f0 /addr2line.c | |
parent | 75e2a26b84e66496644a1a3c32067a7e17f1c7ae (diff) |
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
Diffstat (limited to 'addr2line.c')
-rw-r--r-- | addr2line.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addr2line.c b/addr2line.c index b8d103eb7b..148dbc838c 100644 --- a/addr2line.c +++ b/addr2line.c @@ -458,11 +458,13 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink, fprintf(stderr, "lseek: %s\n", strerror(e)); return; } - if (filesize > SIZE_MAX) { +#if SIZEOF_OFF_T > SIZEOF_SIZE_T + if (filesize > (off_t)SIZE_MAX) { close(fd); fprintf(stderr, "Too large file %s\n", binary_filename); return; } +#endif lseek(fd, 0, SEEK_SET); /* async-signal unsafe */ file = (char *)mmap(NULL, (size_t)filesize, PROT_READ, MAP_SHARED, fd, 0); |