regexp.h: work around -Werror compile failure of XS in linux perf tool
authorJim Cromie <jim.cromie@gmail.com>
Wed, 1 Jun 2011 04:15:11 +0000 (22:15 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 2 Jun 2011 21:31:58 +0000 (15:31 -0600)
The linux perf tool has an XS component, but when built using system
perl 5.14.0, its compilation errors out on the switch statement in
regexp.h: get_regex_charset_name(), which lacks a default case.  Add
one, copying the end-of-function return "?".

Preserve the end-of-function return "?", to avoid a hypothetical
compiler bug which misses the default case, and infers a void return
for a function thats declared otherwize.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
regexp.h

index c4fa609..5776a90 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -323,8 +323,9 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
        case REGEX_ASCII_MORE_RESTRICTED_CHARSET:
            *lenp = 2;
            return ASCII_MORE_RESTRICT_PAT_MODS;
+        default:
+           return "?";     /* Unknown */
     }
-
     return "?";            /* Unknown */
 }