From a67150204eb6dd913846b8d3742550fb152461e1 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 6 Feb 2014 09:57:51 -0700 Subject: [PATCH] regexec.c, locale.c: Silence some compiler warnings For regexec.c, one compiler amongst our smokers believes there is a path where this array can be used uninitialized; it's easiest to just initialize it, even though I think the compiler is wrong, unless it is optimizing incorrectly, in which case, it would be still be best to initialize it. For locale.c, this is just the well-known gcc bug that they refuse to fix concerning a (void) cast when the function has been declared to require not ignoring the resul --- locale.c | 2 ++ regexec.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/locale.c b/locale.c index 8190476..6654468 100644 --- a/locale.c +++ b/locale.c @@ -817,7 +817,9 @@ S_is_cur_LC_category_utf8(pTHX_ int category) * result */ if (is_utf8) { wchar_t wc; + GCC_DIAG_IGNORE(-Wunused-result); (void) mbtowc(&wc, NULL, 0); /* Reset any shift state */ + GCC_DIAG_RESTORE; errno = 0; if (mbtowc(&wc, HYPHEN_UTF8, strlen(HYPHEN_UTF8)) != strlen(HYPHEN_UTF8) diff --git a/regexec.c b/regexec.c index df8bd14..c4d4ee5 100644 --- a/regexec.c +++ b/regexec.c @@ -3546,7 +3546,7 @@ S_setup_EXACTISH_ST_c1_c2(pTHX_ const regnode * const text_node, int *c1p, dVAR; U8 *pat = (U8*)STRING(text_node); - U8 folded[UTF8_MAX_FOLD_CHAR_EXPAND * UTF8_MAXBYTES_CASE + 1]; + U8 folded[UTF8_MAX_FOLD_CHAR_EXPAND * UTF8_MAXBYTES_CASE + 1] = { '\0' }; if (OP(text_node) == EXACT) { -- 2.7.4