[Webkit-unassigned] [Bug 224755] New: URL::URL(HashTableDeletedValueType) triggers -Wuninitialized warnings with GCC 11
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Apr 19 06:59:53 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=224755
Bug ID: 224755
Summary: URL::URL(HashTableDeletedValueType) triggers
-Wuninitialized warnings with GCC 11
Product: WebKit
Version: WebKit Nightly Build
Hardware: PC
OS: Linux
Status: NEW
Severity: Normal
Priority: P2
Component: Web Template Framework
Assignee: webkit-unassigned at lists.webkit.org
Reporter: mcatanzaro at gnome.org
CC: achristensen at apple.com
[2920/5456] Building CXX object Source/WebCore/CMakeFiles...vedSources/unified-sources/UnifiedSource-f74e0903-7.cpp.o
In file included from ../../Source/WebCore/page/SecurityOriginData.h:28,
from ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:30,
from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
In member function ‘WTF::URL& WTF::URL::operator=(WTF::URL&&)’,
inlined from ‘void WebCore::ServiceWorkerRegistrationKey::setScope(WTF::URL&&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:52:44,
inlined from ‘static void WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue(WebCore::ServiceWorkerRegistrationKey&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:99,
inlined from ‘typename std::enable_if<(! WTF::HashTraitHasCustomDelete<Traits, T>::value)>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; T = WebCore::ServiceWorkerRegistrationKey]’ at WTF/Headers/wtf/HashTraits.h:305:34,
inlined from ‘static void WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::customDeleteBucket(WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::TraitType&) [with KeyTraitsArg = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; ValueTraitsArg = WTF::HashTraits<WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:378:42,
inlined from ‘typename std::enable_if<WTF::HashTraitHasCustomDelete<Traits, T>::value>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; T = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:297:31,
inlined from ‘static void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::deleteBucket(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType&) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:549:85,
inlined from ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:1127:21:
WTF/Headers/wtf/URL.h:56:7: warning: ‘*(long unsigned int*)((char*)&<unnamed> + offsetof(WTF::URL, WTF::URL::m_isValid))’ is used uninitialized [-Wuninitialized]
56 | class URL {
| ^~~
In file included from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h: In member function ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:125: note: ‘<anonymous>’ declared here
109 | static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { slot.setScope(URL(HashTableDeletedValue)); }
| ^
In file included from ../../Source/WebCore/page/SecurityOriginData.h:28,
from ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:30,
from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
In member function ‘WTF::URL& WTF::URL::operator=(WTF::URL&&)’,
inlined from ‘void WebCore::ServiceWorkerRegistrationKey::setScope(WTF::URL&&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:52:44,
inlined from ‘static void WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue(WebCore::ServiceWorkerRegistrationKey&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:99,
inlined from ‘typename std::enable_if<(! WTF::HashTraitHasCustomDelete<Traits, T>::value)>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; T = WebCore::ServiceWorkerRegistrationKey]’ at WTF/Headers/wtf/HashTraits.h:305:34,
inlined from ‘static void WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::customDeleteBucket(WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::TraitType&) [with KeyTraitsArg = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; ValueTraitsArg = WTF::HashTraits<WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:378:42,
inlined from ‘typename std::enable_if<WTF::HashTraitHasCustomDelete<Traits, T>::value>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; T = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:297:31,
inlined from ‘static void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::deleteBucket(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType&) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:549:85,
inlined from ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:1127:21:
WTF/Headers/wtf/URL.h:56:7: warning: ‘*(long unsigned int*)((char*)&<unnamed> + offsetof(WTF::URL, WTF::URL::m_userEnd))’ is used uninitialized [-Wuninitialized]
56 | class URL {
| ^~~
In file included from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h: In member function ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:125: note: ‘<anonymous>’ declared here
109 | static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { slot.setScope(URL(HashTableDeletedValue)); }
| ^
In file included from ../../Source/WebCore/page/SecurityOriginData.h:28,
from ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:30,
from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
In member function ‘WTF::URL& WTF::URL::operator=(WTF::URL&&)’,
inlined from ‘void WebCore::ServiceWorkerRegistrationKey::setScope(WTF::URL&&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:52:44,
inlined from ‘static void WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue(WebCore::ServiceWorkerRegistrationKey&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:99,
inlined from ‘typename std::enable_if<(! WTF::HashTraitHasCustomDelete<Traits, T>::value)>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; T = WebCore::ServiceWorkerRegistrationKey]’ at WTF/Headers/wtf/HashTraits.h:305:34,
inlined from ‘static void WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::customDeleteBucket(WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::TraitType&) [with KeyTraitsArg = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; ValueTraitsArg = WTF::HashTraits<WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:378:42,
inlined from ‘typename std::enable_if<WTF::HashTraitHasCustomDelete<Traits, T>::value>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; T = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:297:31,
inlined from ‘static void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::deleteBucket(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType&) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:549:85,
inlined from ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:1127:21:
WTF/Headers/wtf/URL.h:56:7: warning: ‘*(long unsigned int*)((char*)&<unnamed> + offsetof(WTF::URL, WTF::URL::m_hostEnd))’ is used uninitialized [-Wuninitialized]
56 | class URL {
| ^~~
In file included from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h: In member function ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:125: note: ‘<anonymous>’ declared here
109 | static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { slot.setScope(URL(HashTableDeletedValue)); }
| ^
In file included from ../../Source/WebCore/page/SecurityOriginData.h:28,
from ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:30,
from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
In member function ‘WTF::URL& WTF::URL::operator=(WTF::URL&&)’,
inlined from ‘void WebCore::ServiceWorkerRegistrationKey::setScope(WTF::URL&&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:52:44,
inlined from ‘static void WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue(WebCore::ServiceWorkerRegistrationKey&)’ at ../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:99,
inlined from ‘typename std::enable_if<(! WTF::HashTraitHasCustomDelete<Traits, T>::value)>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; T = WebCore::ServiceWorkerRegistrationKey]’ at WTF/Headers/wtf/HashTraits.h:305:34,
inlined from ‘static void WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::customDeleteBucket(WTF::KeyValuePairHashTraits<KeyTraitsArg, ValueTraitsArg>::TraitType&) [with KeyTraitsArg = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>; ValueTraitsArg = WTF::HashTraits<WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:378:42,
inlined from ‘typename std::enable_if<WTF::HashTraitHasCustomDelete<Traits, T>::value>::type WTF::hashTraitsDeleteBucket(T&) [with Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; T = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >]’ at WTF/Headers/wtf/HashTraits.h:297:31,
inlined from ‘static void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::deleteBucket(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType&) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:549:85,
inlined from ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’ at WTF/Headers/wtf/HashTable.h:1127:21:
WTF/Headers/wtf/URL.h:56:7: warning: ‘*(long unsigned int*)((char*)&<unnamed> + offsetof(WTF::URL, WTF::URL::m_pathEnd))’ is used uninitialized [-Wuninitialized]
56 | class URL {
| ^~~
In file included from ../../Source/WebCore/workers/service/server/SWScriptStorage.cpp:32,
from WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-7.cpp:1:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h: In member function ‘void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ValueType*) [with Key = WebCore::ServiceWorkerRegistrationKey; Value = WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> > >; HashFunctions = WTF::DefaultHash<WebCore::ServiceWorkerRegistrationKey>; Traits = WTF::HashMap<WebCore::ServiceWorkerRegistrationKey, WTF::WeakPtr<WebCore::SWServerRegistration> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>]’:
../../Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h:109:125: note: ‘<anonymous>’ declared here
109 | static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { slot.setScope(URL(HashTableDeletedValue)); }
| ^
>From bug #224381, Alex says:
"Very interesting, although unrelated to this change. It looks like it's complaining that URL::URL(HashTableDeletedValueType) doesn't initialize any members but m_string. That's fine because only m_string is used for hash-table-deleted-entry-URLs and probably preferred because it does fewer write operations. Maybe there's a way to silence those warnings or initialize all the members only in builds that would see those warnings."
I dunno, it's more robust to just always initialize everything. The warning is complaining because the partially-uninitialized URL gets passed to ServiceWorkerRegistrationKey's copy assignment operator, so the uninitialized data does get used to initialize another URL. It might be harmless if the data is really never read, but now ServiceWorkerRegistrationKey::scope is going to return a partially-initialized URL. I guess it's probably OK because it's only ever used as the HashTableDeletedValueType, but I think initializing everything is the safer way to go in this case. I doubt there will be any noticeable performance impact.
Alternatively, we could simply silence the warning, which is probably easy to do.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210419/e403e8a0/attachment-0001.htm>
More information about the webkit-unassigned
mailing list