On 03/23/2017 05:27 PM, Andrei Borzenkov wrote:
> If RE_ENABLE_I18N is not defined, FALLTHROUGH will be attributed to
> wrong branch. If someone happens to add case label before #ifdef, it
> will be rather hard to spot.
What about this?
diff --git a/lib/regexec.c b/lib/regexec.c
index ef52b243a..107a5c035 100644
--- a/lib/regexec.c
+++ b/lib/regexec.c
@@ -4079,7 +4079,10 @@ check_node_accept (const re_match_context_t *mctx, const
re_token_t *node,
if (ch >= ASCII_CHARS)
return false;
/* FALLTHROUGH */
+ goto FALLTHRU_TO_OP_PERIOD;
#endif
+
+FALLTHRU_TO_OP_PERIOD:
case OP_PERIOD:
if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE))
|| (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL)))
Okay, some consider goto as ugly ... but it is explicit and
probably efficient as well in this case. ;-)
Have a nice day,
Berny