WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
178209
DataTransfer.cpp triggers -Wunused-but-set-variable
https://bugs.webkit.org/show_bug.cgi?id=178209
Summary
DataTransfer.cpp triggers -Wunused-but-set-variable
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
Details
Formatted Diff
Diff
Patch
(1.32 KB, patch)
2017-10-13 00:07 PDT
,
Tomas Popela
wenson_hsieh
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Tomas Popela
Comment 1
2017-10-12 05:56:31 PDT
Created
attachment 323523
[details]
Patch
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
Created
attachment 323643
[details]
Patch
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
Committed
r223334
: <
https://trac.webkit.org/changeset/223334
>
Radar WebKit Bug Importer
Comment 7
2017-10-15 21:18:24 PDT
<
rdar://problem/35001133
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug