Bug 178209

Summary: DataTransfer.cpp triggers -Wunused-but-set-variable
Product: WebKit Reporter: Tomas Popela <tpopela>
Component: WebCore Misc.Assignee: Tomas Popela <tpopela>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, buildbot, cdumez, dbates, esprehn+autocc, kangil.han, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch wenson_hsieh: review+

Tomas Popela
Reported 2017-10-12 05:53:58 PDT
../../Source/WebCore/dom/DataTransfer.cpp: In member function ‘WTF::Vector<WTF::Ref<WebCore::File> > WebCore::DataTransfer::filesFromPasteboardAndItemList() const’: ../../Source/WebCore/dom/DataTransfer.cpp:289:10: warning: variable ‘addedFilesFromPasteboard’ set but not used [-Wunused-but-set-variable] bool addedFilesFromPasteboard = false; ^~~~~~~~~~~~~~~~~~~~~~~~ ../../Source/WebCore/dom/DataTransfer.cpp:298:10: warning: variable ‘itemListContainsItems’ set but not used [-Wunused-but-set-variable] bool itemListContainsItems = false; ^~~~~~~~~~~~~~~~~~~~~
Attachments
Patch (1.78 KB, patch)
2017-10-12 05:56 PDT, Tomas Popela
no flags
Patch (1.32 KB, patch)
2017-10-13 00:07 PDT, Tomas Popela
wenson_hsieh: review+
Tomas Popela
Comment 1 2017-10-12 05:56:31 PDT
Alex Christensen
Comment 2 2017-10-12 13:29:27 PDT
Comment on attachment 323523 [details] Patch We could also solve this with ASSERT_DISABLED or ASSERT_UNUSED
Tomas Popela
Comment 3 2017-10-12 21:14:33 PDT
(In reply to Alex Christensen from comment #2) > Comment on attachment 323523 [details] > Patch > > We could also solve this with ASSERT_DISABLED or ASSERT_UNUSED I knew there was a better way.. ASSERT_UNUSED is more cleaner solution.
Tomas Popela
Comment 4 2017-10-13 00:07:55 PDT
Wenson Hsieh
Comment 5 2017-10-13 08:30:50 PDT
Comment on attachment 323643 [details] Patch I don't think processedFiles is a great name for this local variable...perhaps make this something like: bool containsItemsAndFiles = itemListContainsItems && addedFilesFromPasteboard; ...and then ASSERT_UNUSED(containsItemsAndFiles, !containsItemsAndFiles);?
Tomas Popela
Comment 6 2017-10-15 21:17:06 PDT
Radar WebKit Bug Importer
Comment 7 2017-10-15 21:18:24 PDT
Note You need to log in before you can comment on or make changes to this bug.