RESOLVED FIXED 182797
Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse()
https://bugs.webkit.org/show_bug.cgi?id=182797
Summary Make maximumParallelReadCount static to fix lambda capture error in WebKit::N...
John Wilander
Reported 2018-02-14 10:51:59 PST
https://trac.webkit.org/changeset/228455 added a lambda capture of const unsigned maximumParallelReadCount. Such a capture is not needed and causes a build error when you run with -Wunused-lambda-capture: WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:911:79: error: lambda capture 'maximumParallelReadCount' is not required to be captured for this use [-Werror,-Wunused-lambda-capture] traverseOperation.activeCondition.wait(lock, [&traverseOperation, maximumParallelReadCount] { ^ 1 error generated.
Attachments
Patch (1.56 KB, patch)
2018-02-14 11:11 PST, John Wilander
no flags
Patch (1.71 KB, patch)
2018-02-14 11:30 PST, John Wilander
thorton: review+
Radar WebKit Bug Importer
Comment 1 2018-02-14 10:54:58 PST
John Wilander
Comment 2 2018-02-14 11:11:08 PST
Andy Estes
Comment 3 2018-02-14 11:22:11 PST
Comment on attachment 333820 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=333820&action=review > Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:911 > - traverseOperation.activeCondition.wait(lock, [&traverseOperation, maximumParallelReadCount] { > + traverseOperation.activeCondition.wait(lock, [&traverseOperation] { Seems like a clang bug if it's warning about maximumParallelReadCount being unused. It's clearly used!
John Wilander
Comment 4 2018-02-14 11:24:33 PST
Yeah. I wonder if clang optimizes it and moved it into the lambda?
Andy Estes
Comment 5 2018-02-14 11:25:30 PST
This patch might be ok if GCC allows maximumParallelReadCount to be used without being captured. We should see what EWS says. Otherwise, we might need to either move the definition of maximumParallelReadCount into the lambda, or make it static.
John Wilander
Comment 6 2018-02-14 11:30:07 PST
John Wilander
Comment 7 2018-02-14 11:37:14 PST
WPE tree seems red.
John Wilander
Comment 8 2018-02-14 11:43:45 PST
Comment on attachment 333823 [details] Patch Thanks, Tim and Andy!
John Wilander
Comment 9 2018-02-14 11:47:59 PST
Note You need to log in before you can comment on or make changes to this bug.