Bug 161841

Summary: URLParser: uidna_IDNToASCII_56 is deprecated
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebCore Misc.Assignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Minor CC: achristensen, ap, mcatanzaro
Priority: P2    
Version: Other   
Hardware: PC   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=144194
Attachments:
Description Flags
Patch achristensen: review+

Michael Catanzaro
Reported 2016-09-10 09:19:13 PDT
Would be good to avoid this -Wdeprecated-declarations warning in URLParser.cpp: ../../Source/WebCore/platform/URLParser.cpp: In function ‘WTF::Optional<WTF::String> WebCore::domainToASCII(const WTF::String&)’: ../../Source/WebCore/platform/URLParser.cpp:1352:193: warning: ‘int32_t uidna_IDNToASCII_56(const UChar*, int32_t, UChar*, int32_t, int32_t, UParseError*, UErrorCode*)’ is deprecated [-Wdeprecated-declarations] int32_t numCharactersConverted = uidna_IDNToASCII(StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, hostnameBufferLength, UIDNA_ALLOW_UNASSIGNED, nullptr, &error); ^ In file included from /usr/include/unicode/platform.h:23:0, from /usr/include/unicode/ptypes.h:50, from /usr/include/unicode/umachine.h:44, from /usr/include/unicode/utypes.h:36, from ../../Source/WTF/wtf/text/ASCIIFastPath.h:26, from ../../Source/WTF/wtf/text/WTFString.h:28, from ../../Source/WebCore/platform/text/TextCodec.h:33, from ../../Source/WebCore/platform/text/TextEncoding.h:29, from ../../Source/WebCore/platform/URLParser.h:28, from ../../Source/WebCore/platform/URLParser.cpp:27: /usr/include/unicode/uidna.h:673:1: note: declared here uidna_IDNToASCII( const UChar* src, int32_t srcLength, ^
Attachments
Patch (1.88 KB, patch)
2016-09-16 20:16 PDT, Michael Catanzaro
achristensen: review+
Michael Catanzaro
Comment 1 2016-09-10 09:31:42 PDT
The header says: @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
Alex Christensen
Comment 2 2016-09-14 11:30:18 PDT
I wondered why we had those #pragma GCC diagnostic ignored "-Wdeprecated-declarations" in URL.cpp. The copy of the ICU headers we use on Cocoa platforms hasn't deprecated that yet. I think a better solution would be to just use uidna_openUTS46 / uidna_close instead.
Alexey Proskuryakov
Comment 3 2016-09-14 13:09:34 PDT
Upgrading the version of standard that we use is definitely better. Bug 144194 has some open questions about that.
Michael Catanzaro
Comment 4 2016-09-14 13:47:38 PDT
I'd like a quick fix for the warning, and I doubt upgrading the standard is going to be it. So if switching to uidna_openUTS46/uidna_close is not easy (I have no idea) then I will just add pragmas there, OK?
Alexey Proskuryakov
Comment 5 2016-09-14 14:01:52 PDT
Yes.
Alex Christensen
Comment 6 2016-09-15 10:33:31 PDT
Adding pragmas with "// FIXME: This should use uidna_openUTS46 / uidna_close instead" would be fine for now.
Michael Catanzaro
Comment 7 2016-09-16 20:16:22 PDT
Alex Christensen
Comment 8 2016-09-20 13:27:42 PDT
Note You need to log in before you can comment on or make changes to this bug.