This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
GCC_DIAG_IGNORE needs to end with semicolon (inline.h).
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 18 Jun 2014 19:36:17 +0000 (15:36 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 18 Jun 2014 21:42:36 +0000 (17:42 -0400)
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.

inline.h
perl.h

index 57275d4..87c2ac4 100644 (file)
--- 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 3c2e4e4..60774a1 100644 (file)
--- a/perl.h
+++ b/perl.h
                              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:  */