regexp.h: remove completely redundant return statement
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>
Fri, 23 Dec 2011 22:17:35 +0000 (22:17 +0000)
committerÆvar Arnfjörð Bjarmason <avar@cpan.org>
Fri, 23 Dec 2011 22:17:35 +0000 (22:17 +0000)
Remove a redundant return() statement at the end of the
get_regex_charset_name function. The "default" case for the above
switch statement will always return for us.

This was added intentionally in v5.14.0-354-g0984e55 by Jim Cromie,
but the rationale for doing so is that we might have a compiler bug
here, but we're pretty screwed anyway if switch statements stop
working as advertised by the standard so there's no reason to be
defensive in this particular case.

This is also causing a lot of whine from Sun Studio 12 Update 1:

    regexp.h", line 329: warning: statement not reached

regexp.h

index 5776a90..5ee6448 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -326,7 +326,6 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
         default:
            return "?";     /* Unknown */
     }
-    return "?";            /* Unknown */
 }
 
 /* Anchor and GPOS related stuff */