WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
213034
Suppress compiler warnings
https://bugs.webkit.org/show_bug.cgi?id=213034
Summary
Suppress compiler warnings
Víctor M. Jáquez L.
Reported
2020-06-10 10:34:11 PDT
Suppress some clang++ warnings. This is also an update of
https://bugs.webkit.org/show_bug.cgi?id=206235
Attachments
Patch
(3.91 KB, patch)
2020-06-10 10:38 PDT
,
Víctor M. Jáquez L.
no flags
Details
Formatted Diff
Diff
Patch
(4.15 KB, patch)
2020-06-15 08:55 PDT
,
Víctor M. Jáquez L.
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Víctor M. Jáquez L.
Comment 1
2020-06-10 10:38:29 PDT
Created
attachment 401555
[details]
Patch
Darin Adler
Comment 2
2020-06-10 10:59:55 PDT
Comment on
attachment 401555
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=401555&action=review
r=me but please consider moving the cast to size_t and doing a follow-up change to FileSystem.
> Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:781 > + LOG(IndexedDB, "UniqueIDBDatabase::putOrAdd quota check with task size: %" PRIu64 " key size: %" PRIu64 " value size: %" PRIu64 " index size: %" PRIu64, taskSize, keySize, valueSize, indexSize);
This is clearly right.
> Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp:154 > + if (static_cast<std::size_t>(bytesRead) == salt.size())
Seems to me that this points to a design mistake, and I am not sure that it’s good to quiet the warning here. Doing the cast here is only safe because we know the number is small enough to fit into size_t. And since the FileSystem::readFromFile function reads data into memory, by definition can’t read a number of bytes that won’t fit into a size_t. But that should be encoded by making the return type of the function be a size_t, not by adding casts. I don’t know what other problems there might be if we made that change. Maybe we should move the static_cast to the line that calls readFromFile and then file a follow-up bug about changing the return type of that function.
> Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp:162 > + bool success = static_cast<std::size_t>(FileSystem::writeToFile(file, reinterpret_cast<char*>(salt.data()), salt.size())) == salt.size();
Ditto: Here it’s better because the cast is right where we call writeToFile, but I think we need that follow-up.
Víctor M. Jáquez L.
Comment 3
2020-06-15 08:55:03 PDT
Created
attachment 401900
[details]
Patch
EWS
Comment 4
2020-06-15 09:44:06 PDT
Committed
r263041
: <
https://trac.webkit.org/changeset/263041
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 401900
[details]
.
Radar WebKit Bug Importer
Comment 5
2020-06-15 09:45:17 PDT
<
rdar://problem/64366435
>
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