1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

compile.c: suppress warning

* compile.c (ibf_dump_overwrite): cast to unsigned long to
  suppress sign-compare warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-08 15:59:05 +00:00
parent 46df9c425e
commit 745c63e9a0

View file

@ -6860,7 +6860,8 @@ ibf_dump_overwrite(struct ibf_dump *dump, void *buff, unsigned int size, long of
{ {
VALUE str = dump->str; VALUE str = dump->str;
char *ptr = RSTRING_PTR(str); char *ptr = RSTRING_PTR(str);
if (size + offset > RSTRING_LEN(str)) rb_bug("ibf_dump_overwrite: overflow"); if ((unsigned long)(size + offset) > (unsigned long)RSTRING_LEN(str))
rb_bug("ibf_dump_overwrite: overflow");
memcpy(ptr + offset, buff, size); memcpy(ptr + offset, buff, size);
} }