RESOLVED INVALID118274
Fix maybe-uninitialized gcc 4.8 warning in HashTable.h
https://bugs.webkit.org/show_bug.cgi?id=118274
Summary Fix maybe-uninitialized gcc 4.8 warning in HashTable.h
Sergio Correia (qrwteyrutiyoup)
Reported 2013-07-01 19:35:16 PDT
[WTF]: Fix maybe-uninitialized gcc 4.8 warning in HashTable.h
Attachments
Patch (1.54 KB, patch)
2013-07-01 19:37 PDT, Sergio Correia (qrwteyrutiyoup)
andersca: review-
andersca: commit-queue-
Sergio Correia (qrwteyrutiyoup)
Comment 1 2013-07-01 19:37:14 PDT
Sergio Correia (qrwteyrutiyoup)
Comment 2 2013-07-01 21:29:10 PDT
The actual warning: In file included from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/MessageDecoder.h:30:0, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.h:32, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.cpp:27: /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/StringReference.h: In member function 'void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkKey(const T&) [with HashTranslator = WTF::HashMapTranslator<WTF::HashMapValueTraits<WTF::HashTraits<std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int> >, WTF::HashTraits<WTF::OwnPtr<CoreIPC::MessageDecoder> > >, WTF::PairHash<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int> >; T = std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int>; Key = std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int>; Value = WTF::KeyValuePair<std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int>, WTF::OwnPtr<CoreIPC::MessageDecoder> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int>, WTF::OwnPtr<CoreIPC::MessageDecoder> > >; HashFunctions = WTF::PairHash<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int>; Traits = WTF::HashMapValueTraits<WTF::HashTraits<std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int> >, WTF::HashTraits<WTF::OwnPtr<CoreIPC::MessageDecoder> > >; KeyTraits = WTF::HashTraits<std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int> >]': /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/StringReference.h:67:76: error: '*((void*)(& deletedValueBuffer)+16).CoreIPC::StringReference::m_data' may be used uninitialized in this function [-Werror=maybe-uninitialized] In file included from /home/sergio/projects/webkitnix/Source/WTF/wtf/HashMap.h:24:0, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/WorkQueue.h:38, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.h:35, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.cpp:27: /home/sergio/projects/webkitnix/Source/WTF/wtf/HashTable.h:592:66: note: '*((void*)(& deletedValueBuffer)+16).CoreIPC::StringReference::m_data' was declared here In file included from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/MessageDecoder.h:30:0, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.h:32, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.cpp:27: /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/StringReference.h:67:76: error: '*((void*)(& deletedValueBuffer)+16).CoreIPC::StringReference::m_size' may be used uninitialized in this function [-Werror=maybe-uninitialized] In file included from /home/sergio/projects/webkitnix/Source/WTF/wtf/HashMap.h:24:0, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/WorkQueue.h:38, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.h:35, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.cpp:27: /home/sergio/projects/webkitnix/Source/WTF/wtf/HashTable.h:592:66: note: '*((void*)(& deletedValueBuffer)+16).CoreIPC::StringReference::m_size' was declared here In file included from /home/sergio/projects/webkitnix/Source/WTF/wtf/HashTraits.h:24:0, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/StringReference.h:30, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/MessageDecoder.h:30, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.h:32, from /home/sergio/projects/webkitnix/Source/WebKit2/Platform/CoreIPC/Connection.cpp:27: /home/sergio/projects/webkitnix/Source/WTF/wtf/HashFunctions.h:157:115: error: 'deletedValueBuffer.std::pair<std::pair<CoreIPC::StringReference, CoreIPC::StringReference>, long unsigned int>::second' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Anders Carlsson
Comment 3 2013-07-02 09:52:20 PDT
Comment on attachment 205855 [details] Patch I don’t think we want to add an extra memset in order to silence a warning.
Sergio Correia (qrwteyrutiyoup)
Comment 4 2013-07-02 10:36:03 PDT
(In reply to comment #3) > (From update of attachment 205855 [details]) > I don’t think we want to add an extra memset in order to silence a warning. Makes sense. I was wondering whether there was a way to build this without disabling the warning-as-error flag. Thanks for the review.
Anders Carlsson
Comment 5 2013-07-02 10:37:32 PDT
(In reply to comment #4) > (In reply to comment #3) > > (From update of attachment 205855 [details] [details]) > > I don’t think we want to add an extra memset in order to silence a warning. > > Makes sense. I was wondering whether there was a way to build this without disabling the warning-as-error flag. > > Thanks for the review. I don’t think -wmaybe-uninitialized is a useful enough warning that it should be enabled by default.
Sergio Correia (qrwteyrutiyoup)
Comment 6 2013-07-02 10:44:34 PDT
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > > (From update of attachment 205855 [details] [details] [details]) > > > I don’t think we want to add an extra memset in order to silence a warning. > > > > Makes sense. I was wondering whether there was a way to build this without disabling the warning-as-error flag. > > > > Thanks for the review. > > I don’t think -wmaybe-uninitialized is a useful enough warning that it should be enabled by default. Okay, I will disable it locally for now and close this bug as invalid.
Darin Adler
Comment 7 2013-07-02 12:06:16 PDT
(In reply to comment #3) > I don’t think we want to add an extra memset in order to silence a warning. But this is assertion code, not production code. Maybe it’s OK given that?
Note You need to log in before you can comment on or make changes to this bug.