WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 162553
Fix -Wformat warnings in WebLoaderStrategy
https://bugs.webkit.org/show_bug.cgi?id=162553
Summary
Fix -Wformat warnings in WebLoaderStrategy
Michael Catanzaro
Reported
2016-09-26 02:04:49 PDT
Fix -Wformat warnings in WebLoaderStrategy: [5257/6045] Building CXX object Source...rocess/Network/WebLoaderStrategy.cpp.o In file included from ../../Source/WTF/wtf/StdLibExtras.h:33:0, from ../../Source/WTF/wtf/FastMalloc.h:26, from ../../Source/WebKit2/config.h:44, from ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp:26: ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp: In member function ‘void WebKit::WebLoaderStrategy::scheduleLoad(WebCore::ResourceLoader&, WebCore::CachedResource*, bool)’: ../../Source/WTF/wtf/Assertions.h:386:91: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=] #define LOG_ERROR(...) WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__) ^ ../../Source/WTF/wtf/Assertions.h:409:49: note: in expansion of macro ‘LOG_ERROR’ #define RELEASE_LOG_ERROR(channel, format, ...) LOG_ERROR(format, ##__VA_ARGS__) ^~~~~~~~~ ../../Source/WTF/wtf/Assertions.h:412:83: note: in expansion of macro ‘RELEASE_LOG_ERROR’ #define RELEASE_LOG_ERROR_IF(isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, format, ##__VA_ARGS__); } while (0) ^~~~~~~~~~~~~~~~~ ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp:61:67: note: in expansion of macro ‘RELEASE_LOG_ERROR_IF’ #define RELEASE_LOG_ERROR_IF_ALLOWED(permissionChecker, fmt, ...) RELEASE_LOG_ERROR_IF(permissionChecker.isAlwaysOnLoggingAllowed(), Network, "%p - WebLoaderStrategy::" fmt, this, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~ ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp:217:9: note: in expansion of macro ‘RELEASE_LOG_ERROR_IF_ALLOWED’ RELEASE_LOG_ERROR_IF_ALLOWED(resourceLoader, "scheduleLoad: Unable to schedule resource with the NetworkProcess (frame = %p, priority = %d, pageID = %llu, frameID = %llu, resourceID = %llu)", resourceLoader.frame(), static_cast<int>(resourceLoader.request().priority()), loadParameters.webPageID, loadParameters.identifier, loadParameters.webFrameID); ^ ../../Source/WTF/wtf/Assertions.h:386:91: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 9 has type ‘WebKit::ResourceLoadIdentifier {aka long unsigned int}’ [-Wformat=] #define LOG_ERROR(...) WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__) ^ ../../Source/WTF/wtf/Assertions.h:409:49: note: in expansion of macro ‘LOG_ERROR’ #define RELEASE_LOG_ERROR(channel, format, ...) LOG_ERROR(format, ##__VA_ARGS__) ^~~~~~~~~ ../../Source/WTF/wtf/Assertions.h:412:83: note: in expansion of macro ‘RELEASE_LOG_ERROR’ #define RELEASE_LOG_ERROR_IF(isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, format, ##__VA_ARGS__); } while (0) ^~~~~~~~~~~~~~~~~ ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp:61:67: note: in expansion of macro ‘RELEASE_LOG_ERROR_IF’ #define RELEASE_LOG_ERROR_IF_ALLOWED(permissionChecker, fmt, ...) RELEASE_LOG_ERROR_IF(permissionChecker.isAlwaysOnLoggingAllowed(), Network, "%p - WebLoaderStrategy::" fmt, this, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~ ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp:217:9: note: in expansion of macro ‘RELEASE_LOG_ERROR_IF_ALLOWED’ RELEASE_LOG_ERROR_IF_ALLOWED(resourceLoader, "scheduleLoad: Unable to schedule resource with the NetworkProcess (frame = %p, priority = %d, pageID = %llu, frameID = %llu, resourceID = %llu)", resourceLoader.frame(), static_cast<int>(resourceLoader.request().priority()), loadParameters.webPageID, loadParameters.identifier, loadParameters.webFrameID); ^ ../../Source/WTF/wtf/Assertions.h:386:91: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 10 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=] #define LOG_ERROR(...) WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__) ^ ../../Source/WTF/wtf/Assertions.h:409:49: note: in expansion of macro ‘LOG_ERROR’ #define RELEASE_LOG_ERROR(channel, format, ...) LOG_ERROR(format, ##__VA_ARGS__) ^~~~~~~~~ ../../Source/WTF/wtf/Assertions.h:412:83: note: in expansion of macro ‘RELEASE_LOG_ERROR’ #define RELEASE_LOG_ERROR_IF(isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, format, ##__VA_ARGS__); } while (0) ^~~~~~~~~~~~~~~~~ ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp:61:67: note: in expansion of macro ‘RELEASE_LOG_ERROR_IF’ #define RELEASE_LOG_ERROR_IF_ALLOWED(permissionChecker, fmt, ...) RELEASE_LOG_ERROR_IF(permissionChecker.isAlwaysOnLoggingAllowed(), Network, "%p - WebLoaderStrategy::" fmt, this, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~ ../../Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp:217:9: note: in expansion of macro ‘RELEASE_LOG_ERROR_IF_ALLOWED’ RELEASE_LOG_ERROR_IF_ALLOWED(resourceLoader, "scheduleLoad: Unable to schedule resource with the NetworkProcess (frame = %p, priority = %d, pageID = %llu, frameID = %llu, resourceID = %llu)", resourceLoader.frame(), static_cast<int>(resourceLoader.request().priority()), loadParameters.webPageID, loadParameters.identifier, loadParameters.webFrameID); ^
Attachments
Patch
(2.45 KB, patch)
2016-09-26 04:52 PDT
,
Michael Catanzaro
no flags
Details
Formatted Diff
Diff
Patch
(27.28 KB, patch)
2016-09-26 05:49 PDT
,
Michael Catanzaro
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2016-09-26 02:30:59 PDT
Two problems here: * Need to use the PRIu64 macro rather to print a uint64_t, not %lld * The loadParameters.webFrameID argument is in the wrong place, swapped with loadParameters.identifier
Michael Catanzaro
Comment 2
2016-09-26 02:31:38 PDT
(In reply to
comment #1
)
> Two problems here: > > * Need to use the PRIu64 macro rather to print a uint64_t, not %lld
(I meant: not %llu)
Michael Catanzaro
Comment 3
2016-09-26 04:45:37 PDT
I'm going to split this into two commits. First, an unreviewed commit to fix the order of the parameters. Next, a patch here to fix use of %llu. I'll audit each use of RELEASE_LOG_IF_ALLOWED in WebKit2.
Michael Catanzaro
Comment 4
2016-09-26 04:52:23 PDT
Created
attachment 289819
[details]
Patch
Michael Catanzaro
Comment 5
2016-09-26 04:56:47 PDT
Committed
r206371
: <
http://trac.webkit.org/changeset/206371
>
Michael Catanzaro
Comment 6
2016-09-26 04:57:36 PDT
Reopening for part two
Michael Catanzaro
Comment 7
2016-09-26 05:49:27 PDT
Created
attachment 289822
[details]
Patch
WebKit Commit Bot
Comment 8
2016-09-26 08:27:20 PDT
Comment on
attachment 289822
[details]
Patch Clearing flags on attachment: 289822 Committed
r206376
: <
http://trac.webkit.org/changeset/206376
>
WebKit Commit Bot
Comment 9
2016-09-26 08:27:25 PDT
All reviewed patches have been landed. Closing bug.
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