mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
file.c: suppress a warning
* file.c (statfs_fsid): use union to suppress strict-aliasing warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
026b0b9469
commit
c143b9a0ab
1 changed files with 6 additions and 2 deletions
8
file.c
8
file.c
|
@ -5529,8 +5529,12 @@ statfs_ffree(VALUE self)
|
|||
static VALUE
|
||||
statfs_fsid(VALUE self)
|
||||
{
|
||||
fsid_t n = get_statfs(self)->f_fsid;
|
||||
return LL2NUM(*(LONG_LONG*)&n);
|
||||
union {
|
||||
uint64_t v;
|
||||
fsid_t f;
|
||||
} n = {0};
|
||||
n.f = get_statfs(self)->f_fsid;
|
||||
return LL2NUM(n.v);
|
||||
}
|
||||
|
||||
#ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME
|
||||
|
|
Loading…
Reference in a new issue