RESOLVED FIXED 62630
Remove dead code in DumpRenderTree/TestNetscapePlugIn/main.cpp
https://bugs.webkit.org/show_bug.cgi?id=62630
Summary Remove dead code in DumpRenderTree/TestNetscapePlugIn/main.cpp
Andras Becsi
Reported 2011-06-14 05:12:28 PDT
http://trac.webkit.org/changeset/88712 revealed a dead variable: Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:135:10: error: variable 'forceCarbon' set but not used [-Werror=unused-but-set-variable] The forceCarbon variable is initialized false in the common code-path, then checked in a section guarded by XP_MACOSX: Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:168: if (supportsCocoa && !forceCarbon) and then set to true in Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:218 else if (strcasecmp(argn[i], "forcecarbon") == 0) forceCarbon = true; Since forceCarbon is always false in main.cpp:168 it is irrelevant in this function and can be removed.
Attachments
proposed patch (1.93 KB, patch)
2011-06-14 05:16 PDT, Andras Becsi
no flags
Csaba Osztrogonác
Comment 1 2011-06-14 05:15:32 PDT
(In reply to comment #0) > http://trac.webkit.org/changeset/88712 revealed a dead variable: > > Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:135:10: error: variable 'forceCarbon' set but not used [-Werror=unused-but-set-variable] > > The forceCarbon variable is initialized false in the common code-path, then checked in a section guarded by XP_MACOSX: > > Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:168: if (supportsCocoa && !forceCarbon) > > and then set to true in Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:218 > > else if (strcasecmp(argn[i], "forcecarbon") == 0) > forceCarbon = true; > > Since forceCarbon is always false in main.cpp:168 it is irrelevant in this function and can be removed. I agree. Additionally setting forceCarbon to true in main.cpp:219 is dead code, because its value isn't used after this line. It should be removed too.
Andras Becsi
Comment 2 2011-06-14 05:16:14 PDT
Created attachment 97098 [details] proposed patch
Csaba Osztrogonác
Comment 3 2011-06-14 05:21:53 PDT
Comment on attachment 97098 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=97098&action=review LGTM, r=me, but please rename the bug to "Remove dead code in DumpRenderTree/TestNetscapePlugIn/main.cpp" > Tools/ChangeLog:5 > + [Qt] Fix the build with gcc 4.6 after r88712. The bug name is misleading, because it isn't Qt specific bug, but we need a simple dead code elimination.
Andras Becsi
Comment 4 2011-06-14 05:32:48 PDT
(In reply to comment #3) > (From update of attachment 97098 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=97098&action=review > > LGTM, r=me, but please rename the bug to "Remove dead code in DumpRenderTree/TestNetscapePlugIn/main.cpp" > > > Tools/ChangeLog:5 > > + [Qt] Fix the build with gcc 4.6 after r88712. > > The bug name is misleading, because it isn't Qt specific > bug, but we need a simple dead code elimination. Committed in r88791
Andras Becsi
Comment 5 2011-06-14 05:33:12 PDT
Comment on attachment 97098 [details] proposed patch Clearing flags.
Note You need to log in before you can comment on or make changes to this bug.