diff options
author | Zefram <zefram@fysh.org> | 2017-12-01 01:39:57 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-01 01:41:39 +0000 |
commit | 009165e9970c3fcc3a252874e1ed96b1733976ea (patch) | |
tree | 80b975deefc36b9ca36df08cbd1702a2f12a497f /pp_sys.c | |
parent | 64072da0d64f4e24d5d3f53f391a1fb7a5121ac0 (diff) | |
download | perl-009165e9970c3fcc3a252874e1ed96b1733976ea.tar.gz |
revert changes to st_ino signedness handling
This reverts commits 8843856e9716655549cce789b3338e1d4c72fffb,
3676f9e77d46b61f4785aad171f02bed29df0c07, and
793c2ded15ca832d1df1fabbc3b2e7562a057697.
As noted in the large comment above the relevant code, the probed
ST_INO_SIGN is not reliable enough for its purpose, because Configure
makes guesses. The actual compiler knows whether st_ino is signed,
and is perfectly capable of optimising out the negative-handling code
in the usual case that st_ino is unsigned, without any need for us to
preprocess it away.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -3012,13 +3012,14 @@ PP(pp_stat) * st_ino; and (d) sprintf() doesn't necessarily support * integers as large as st_ino. */ + bool neg; Stat_t s; CLANG_DIAG_IGNORE(-Wtautological-compare); GCC_DIAG_IGNORE(-Wtype-limits); + neg = PL_statcache.st_ino < 0; GCC_DIAG_RESTORE; CLANG_DIAG_RESTORE; -#if ST_INO_SIGN == -1 - if (PL_statcache.st_ino < 0) { + if (neg) { s.st_ino = (IV)PL_statcache.st_ino; if (LIKELY(s.st_ino == PL_statcache.st_ino)) { mPUSHi(s.st_ino); @@ -3036,9 +3037,7 @@ PP(pp_stat) *--p = '-'; mPUSHp(p, buf+sizeof(buf) - p); } - } else -#endif - { + } else { s.st_ino = (UV)PL_statcache.st_ino; if (LIKELY(s.st_ino == PL_statcache.st_ino)) { mPUSHu(s.st_ino); |