RESOLVED FIXED Bug 24099
ARM Compiler Warnings in pcre_exec.cpp
https://bugs.webkit.org/show_bug.cgi?id=24099
Summary ARM Compiler Warnings in pcre_exec.cpp
Carol Szabo
Reported 2009-02-23 11:35:00 PST
When compiling pcre_exec.cpp the ARM Compiler issues the following warnings: "../JavaScriptCore/pcre/pcre_exec.cpp", line 1823: Warning: #546-D: transfer of control bypasses initialization of: variable "othercase" (declared at line 1189) case 28: goto RRETURN_28; ^ "../JavaScriptCore/pcre/pcre_exec.cpp", line 1824: Warning: #546-D: transfer of control bypasses initialization of: variable "othercase" (declared at line 1189) case 29: goto RRETURN_29; This is due to the fact that the variable "othercase" declared, defined and initialized in line 1189 goes out of scope and back in scope for non GCC compilers, that is when USE_COMPUTED_GOTO_FOR_MATCH_RECURSION is not defined. In this case execution branches out from line 1203 during expansion of the RECURSIVE_MATCH MACRO to line 1823 where othercase is out of scope un then execution is resumed at line 1204 when the variable is in scope but not initialized. Most recent compilers do not pick this up as an error (like GCC does when used with relevant flags), but the practice of by-passing declaration of local variables via goto or case statements is not very portable and is confusing. These warnings and potential gcc errors can be easily eliminated by moving the declaration of "othercase" to function scope, which has no adverse effects. Patch will follow.
Attachments
Proposed fix. (1.70 KB, patch)
2009-02-23 11:45 PST, Carol Szabo
darin: review+
Carol Szabo
Comment 1 2009-02-23 11:45:50 PST
Created attachment 27886 [details] Proposed fix.
Darin Adler
Comment 2 2009-02-24 13:32:08 PST
Comment on attachment 27886 [details] Proposed fix. Seems OK. r=me
Holger Freyther
Comment 3 2009-02-26 09:12:21 PST
Landed in r41252.
Note You need to log in before you can comment on or make changes to this bug.