From 952db0d7ad3872dd675d23f7e60ae3298a8d8d52 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 15 Mar 2011 11:40:00 -0700 Subject: [PATCH] * regex.c (FREE_VAR): Rewrite so as not to use empty "else", which gcc can warn about. --- src/ChangeLog | 2 ++ src/regex.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2bcca8b0562..e533b07d41a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,8 @@ (regex_compile, re_match_2_internal): Move locals to avoid shadowing. (regex_compile, re_search_2, re_match_2_internal): Remove unused local vars. + (FREE_VAR): Rewrite so as not to use empty "else", + which gcc can warn about. * search.c (boyer_moore): Rename locals to avoid shadowing. * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE): Likewise. diff --git a/src/regex.c b/src/regex.c index 0187a103b32..9c950a42b22 100644 --- a/src/regex.c +++ b/src/regex.c @@ -4666,7 +4666,14 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2, /* Free everything we malloc. */ #ifdef MATCH_MAY_ALLOCATE -# define FREE_VAR(var) if (var) { REGEX_FREE (var); var = NULL; } else +# define FREE_VAR(var) \ + do { \ + if (var) \ + { \ + REGEX_FREE (var); \ + var = NULL; \ + } \ + } while (0) # define FREE_VARIABLES() \ do { \ REGEX_FREE_STACK (fail_stack.stack); \ -- 2.39.2