summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-06-18 15:36:17 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-06-18 17:42:36 -0400
commita3ccabcaeadf665f84ad52c7504a4a2e78ed5c8f (patch)
tree50d66db17970b697a3586d1be8092f6bc3e6ef25
parent9bfc1d15e1a9304ab5c1171ac7e258687c650bab (diff)
downloadperl-a3ccabcaeadf665f84ad52c7504a4a2e78ed5c8f.tar.gz
GCC_DIAG_IGNORE needs to end with semicolon (inline.h).
Furthermore, make the GCC_DIAG_IGNORE and _RESTORE to be dNOOPs, so that they can be at any level of the code, including global, even when the compiler is not gcc (or lookalike). If they are just empty, ";" will be left at the call site.
-rw-r--r--inline.h2
-rw-r--r--perl.h5
2 files changed, 3 insertions, 4 deletions
diff --git a/inline.h b/inline.h
index 57275d414e..87c2ac47f3 100644
--- a/inline.h
+++ b/inline.h
@@ -188,7 +188,7 @@ S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp)
/* ------------------------------- handy.h ------------------------------- */
/* saves machine code for a common noreturn idiom typically used in Newx*() */
-GCC_DIAG_IGNORE(-Wunused-function)
+GCC_DIAG_IGNORE(-Wunused-function);
static void
S_croak_memory_wrap(void)
{
diff --git a/perl.h b/perl.h
index 3c2e4e4cb0..60774a1f8a 100644
--- a/perl.h
+++ b/perl.h
@@ -394,11 +394,10 @@
GCC_DIAG_DO_PRAGMA_(GCC diagnostic ignored #x)
# define GCC_DIAG_RESTORE _Pragma("GCC diagnostic pop")
#else
-# define GCC_DIAG_IGNORE(w)
-# define GCC_DIAG_RESTORE
+# define GCC_DIAG_IGNORE(w) dNOOP
+# define GCC_DIAG_RESTORE dNOOP
#endif
-
#define NOOP /*EMPTY*/(void)0
/* cea2e8a9dd23747f accidentally lost the comment originally from the first
check in of thread.h, explaining why we need dNOOP at all: */