Bug 161841 - URLParser: uidna_IDNToASCII_56 is deprecated
Summary: URLParser: uidna_IDNToASCII_56 is deprecated
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Minor
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-10 09:19 PDT by Michael Catanzaro
Modified: 2016-09-20 13:27 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.88 KB, patch)
2016-09-16 20:16 PDT, Michael Catanzaro
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 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,
 ^
Comment 1 Michael Catanzaro 2016-09-10 09:31:42 PDT
The header says:

@deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
Comment 2 Alex Christensen 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.
Comment 3 Alexey Proskuryakov 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.
Comment 4 Michael Catanzaro 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?
Comment 5 Alexey Proskuryakov 2016-09-14 14:01:52 PDT
Yes.
Comment 6 Alex Christensen 2016-09-15 10:33:31 PDT
Adding pragmas with "// FIXME: This should use uidna_openUTS46 / uidna_close instead" would be fine for now.
Comment 7 Michael Catanzaro 2016-09-16 20:16:22 PDT
Created attachment 289156 [details]
Patch
Comment 8 Alex Christensen 2016-09-20 13:27:42 PDT
http://trac.webkit.org/changeset/206169