From 7347ee5481c77d2fdb023e0a1c19943d039ecc86 Mon Sep 17 00:00:00 2001 From: Zefram Date: Sat, 16 Dec 2017 07:12:48 +0000 Subject: 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]. --- doio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doio.c') diff --git a/doio.c b/doio.c index c98a5f5e44..8a47ad35ab 100644 --- a/doio.c +++ b/doio.c @@ -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; } -- cgit v1.2.1