RESOLVED WORKSFORME 88309
[Qt][Win] Fix const problem in Source/WebCore/xml/parser/XMLDocumentParserQt.cpp
https://bugs.webkit.org/show_bug.cgi?id=88309
Summary [Qt][Win] Fix const problem in Source/WebCore/xml/parser/XMLDocumentParserQt.cpp
Csaba Osztrogonác
Reported 2012-06-05 01:26:40 PDT
The compiler (MSVC) said that Attribute local variable in ctr in Source/WebCore/xml/parser/XMLDocumentParserQt.cpp should be const, because const Attribute * -> Attribute * conversion isn't allowed.
Attachments
Patch (1.66 KB, patch)
2012-06-05 07:18 PDT, Csaba Osztrogonác
no flags
Csaba Osztrogonác
Comment 1 2012-06-05 07:18:12 PDT
Created attachment 145785 [details] Patch I trust in MSVC. :) Let's see the other bots' opinion ...
Csaba Osztrogonác
Comment 2 2012-06-05 08:56:20 PDT
Ah, the build error which is fixed by the attached patch: f:\WebKit\Source\WebCore\xml\parser\XMLDocumentParserQt.cpp(143) : error C2440: 'initializing' : cannot convert from 'const WebCore::Attribute *' to 'WebCore::Attribute *' Conversion loses qualifiers NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\Bi n\cl.EXE"' : return code '0x2'
Simon Hausmann
Comment 3 2012-06-05 14:26:32 PDT
Comment on attachment 145785 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=145785&action=review > Source/WebCore/xml/parser/XMLDocumentParserQt.cpp:143 > - Attribute* attr = attrs->attributeItem(i); > + const Attribute* attr = attrs->attributeItem(i); I'm confused. Why does the compiler think the return value of attributeItem() is a const Attribute* given the signature in ElementAttributeData: dom/ElementAttributeData.h: Attribute* attributeItem(unsigned index) const { return &const_cast<ElementAttributeData*>(this)->m_attributes[index]; }
Csaba Osztrogonác
Comment 4 2012-06-07 05:17:43 PDT
I can't see inside the MSVC's soul, so I have no idea ... But the patch I attached would make it happy. :)
Csaba Osztrogonác
Comment 5 2012-06-12 06:33:35 PDT
ping r?
Csaba Osztrogonác
Comment 6 2012-06-12 08:37:18 PDT
I don't know what changed in WebKit, but it seems it works now without this patch. (I'll reopen if it occurs again.)
Note You need to log in before you can comment on or make changes to this bug.