diff options
author | Zefram <zefram@fysh.org> | 2017-12-16 07:12:48 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-16 07:12:48 +0000 |
commit | 7347ee5481c77d2fdb023e0a1c19943d039ecc86 (patch) | |
tree | 33070b53fbf3d2c5c3408c580e3026b9b4e9e1d5 /doio.c | |
parent | 64def2aeaeb63f92dadc6dfa33486c1d7b311963 (diff) | |
download | perl-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 'doio.c')
-rw-r--r-- | doio.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -629,9 +629,9 @@ S_openn_cleanup(pTHX_ GV *gv, IO *io, PerlIO *fp, char *mode, const char *oname, ) { - GCC_DIAG_IGNORE(-Wformat-nonliteral); /* PL_warn_nl is constant */ + GCC_DIAG_IGNORE_STMT(-Wformat-nonliteral); /* PL_warn_nl is constant */ Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "open"); - GCC_DIAG_RESTORE; + GCC_DIAG_RESTORE_STMT; } goto say_false; } @@ -1888,9 +1888,9 @@ Perl_my_stat_flags(pTHX_ const U32 flags) PL_laststatval = PerlLIO_stat(d, &PL_statcache); } if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && should_warn_nl(s)) { - GCC_DIAG_IGNORE(-Wformat-nonliteral); /* PL_warn_nl is constant */ + GCC_DIAG_IGNORE_STMT(-Wformat-nonliteral); /* PL_warn_nl is constant */ Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat"); - GCC_DIAG_RESTORE; + GCC_DIAG_RESTORE_STMT; } return PL_laststatval; } @@ -1959,9 +1959,9 @@ Perl_my_lstat_flags(pTHX_ const U32 flags) PL_laststatval = PerlLIO_lstat(file,&PL_statcache); } if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && should_warn_nl(file)) { - GCC_DIAG_IGNORE(-Wformat-nonliteral); /* PL_warn_nl is constant */ + GCC_DIAG_IGNORE_STMT(-Wformat-nonliteral); /* PL_warn_nl is constant */ Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "lstat"); - GCC_DIAG_RESTORE; + GCC_DIAG_RESTORE_STMT; } return PL_laststatval; } |