summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-16 07:12:48 +0000
committerZefram <zefram@fysh.org>2017-12-16 07:12:48 +0000
commit7347ee5481c77d2fdb023e0a1c19943d039ecc86 (patch)
tree33070b53fbf3d2c5c3408c580e3026b9b4e9e1d5 /pp_sys.c
parent64def2aeaeb63f92dadc6dfa33486c1d7b311963 (diff)
downloadperl-7347ee5481c77d2fdb023e0a1c19943d039ecc86.tar.gz
semicolon-friendly diagnostic control
New macros {GCC,CLANG}_DIAG_{IGNORE,RESTORE}_{DECL,STMT}, which take a following semicolon. It is necessary to use the _DECL or _STMT version as appropriate to the context. Fixes [perl #130726].
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pp_sys.c b/pp_sys.c
index d94bf2fa20..beb60da4c6 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2981,9 +2981,9 @@ PP(pp_stat)
if (PL_laststatval < 0) {
if (ckWARN(WARN_NEWLINE) && should_warn_nl(file)) {
/* PL_warn_nl is constant */
- GCC_DIAG_IGNORE(-Wformat-nonliteral);
+ GCC_DIAG_IGNORE_STMT(-Wformat-nonliteral);
Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat");
- GCC_DIAG_RESTORE;
+ GCC_DIAG_RESTORE_STMT;
}
max = 0;
}
@@ -3014,11 +3014,11 @@ PP(pp_stat)
*/
bool neg;
Stat_t s;
- CLANG_DIAG_IGNORE(-Wtautological-compare);
- GCC_DIAG_IGNORE(-Wtype-limits);
+ CLANG_DIAG_IGNORE_STMT(-Wtautological-compare);
+ GCC_DIAG_IGNORE_STMT(-Wtype-limits);
neg = PL_statcache.st_ino < 0;
- GCC_DIAG_RESTORE;
- CLANG_DIAG_RESTORE;
+ GCC_DIAG_RESTORE_STMT;
+ CLANG_DIAG_RESTORE_STMT;
if (neg) {
s.st_ino = (IV)PL_statcache.st_ino;
if (LIKELY(s.st_ino == PL_statcache.st_ino)) {
@@ -3593,9 +3593,9 @@ PP(pp_fttext)
}
if (ckWARN(WARN_NEWLINE) && should_warn_nl(file)) {
/* PL_warn_nl is constant */
- GCC_DIAG_IGNORE(-Wformat-nonliteral);
+ GCC_DIAG_IGNORE_STMT(-Wformat-nonliteral);
Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "open");
- GCC_DIAG_RESTORE;
+ GCC_DIAG_RESTORE_STMT;
}
FT_RETURNUNDEF;
}