use __attribute__unused__ to silence -Wunused-but-set-variable
authorRobin Barker <rmbarker@cpan.org>
Sun, 15 May 2011 13:40:46 +0000 (14:40 +0100)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 19 May 2011 19:56:07 +0000 (12:56 -0700)
regcomp.h
regexec.c

index c8f593b..6826ae0 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
@@ -836,7 +836,8 @@ re.pm, especially to the documentation.
 
 #ifdef DEBUGGING
 
-#define GET_RE_DEBUG_FLAGS_DECL VOL IV re_debug_flags = 0; GET_RE_DEBUG_FLAGS;
+#define GET_RE_DEBUG_FLAGS_DECL VOL IV re_debug_flags \
+       __attribute__unused__ = 0; GET_RE_DEBUG_FLAGS;
 
 #define RE_PV_COLOR_DECL(rpv,rlen,isuni,dsv,pv,l,m,c1,c2) \
     const char * const rpv =                          \
index fd90ad7..6b32aa2 100644 (file)
--- a/regexec.c
+++ b/regexec.c
 
 /* these are unrolled below in the CCC_TRY_XXX defined */
 #define LOAD_UTF8_CHARCLASS(class,str) STMT_START { \
-    if (!CAT2(PL_utf8_,class)) { bool ok; ENTER; save_re_context(); ok=CAT2(is_utf8_,class)((const U8*)str); assert(ok); LEAVE; } } STMT_END
+    if (!CAT2(PL_utf8_,class)) { \
+       bool ok; \
+       ENTER; save_re_context(); \
+       ok=CAT2(is_utf8_,class)((const U8*)str); \
+       assert(ok); LEAVE; } } STMT_END
 
 /* Doesn't do an assert to verify that is correct */
 #define LOAD_UTF8_CHARCLASS_NO_CHECK(class) STMT_START { \
-    if (!CAT2(PL_utf8_,class)) { bool throw_away; ENTER; save_re_context(); throw_away = CAT2(is_utf8_,class)((const U8*)" "); LEAVE; } } STMT_END
+    if (!CAT2(PL_utf8_,class)) { \
+       bool throw_away __attribute__unused__; \
+       ENTER; save_re_context(); \
+       throw_away = CAT2(is_utf8_,class)((const U8*)" "); \
+       LEAVE; } } STMT_END
 
 #define LOAD_UTF8_CHARCLASS_ALNUM() LOAD_UTF8_CHARCLASS(alnum,"a")
 #define LOAD_UTF8_CHARCLASS_DIGIT() LOAD_UTF8_CHARCLASS(digit,"0")