summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-01 01:39:57 +0000
committerZefram <zefram@fysh.org>2017-12-01 01:41:39 +0000
commit009165e9970c3fcc3a252874e1ed96b1733976ea (patch)
tree80b975deefc36b9ca36df08cbd1702a2f12a497f /pp_sys.c
parent64072da0d64f4e24d5d3f53f391a1fb7a5121ac0 (diff)
downloadperl-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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 30b373bd3a..7a4c4ab1ef 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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);