<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>299689</bug_id>
          
          <creation_ts>2025-09-28 00:08:23 -0700</creation_ts>
          <short_desc>Clang 21 complains about implicit casting between char32_t and char16_t throughout the codebase</short_desc>
          <delta_ts>2025-10-05 00:09:15 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=299535</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Kirsling">ross.kirsling</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>darin</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2146570</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2025-09-28 00:08:23 -0700</bug_when>
    <thetext>As of 271373@main, we decided to turn UChar32 (i.e. int32_t) into char32_t.
More recently, we&apos;ve also replaced UChar with char16_t (though that part is not an issue).

Clang 21 introduces `character-conversion` warnings for implicit conversion between char32_t and char16_t
(in both directions, citing it &quot;may change the meaning of the represented code unit&quot;).

Addressing this will be a similarly-sized endeavor to 271373@main itself, and unfortunately involves patching gtest too.
It took a couple of hours just to get through WTF, PAL, and gtest—see attached patch.

I will temporarily set `-Wno-character-conversion` for PS port just because it&apos;s blocking our deployment of extra EWS bots.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146571</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2025-09-28 00:12:36 -0700</bug_when>
    <thetext>I&apos;m getting 403 Forbidden when trying to attach a patch; you can find it on Slack instead:
https://webkit.slack.com/archives/CU64U6FDW/p1759041829898719?thread_ts=1758976128.172549&amp;cid=CU64U6FDW</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146580</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2025-09-28 01:03:30 -0700</bug_when>
    <thetext>`-Wno-character-conversion` has now been temporarily set for PS port:
https://commits.webkit.org/300663@main</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146630</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2025-09-28 12:36:27 -0700</bug_when>
    <thetext>Ideally we would come up with a good way to set the warning flags based on clang version rather than platform.

Dave, this new warning is coming up soon in clang 21.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146937</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2025-09-29 13:14:22 -0700</bug_when>
    <thetext>*** Bug 299535 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146977</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2025-09-29 15:59:16 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/51527</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146986</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2025-09-29 16:24:44 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #3)
&gt; Ideally we would come up with a good way to set the warning flags based on
&gt; clang version rather than platform.

WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS checks whether the flag is supported or not, so it&apos;s safe to use it unconditionally. Ross proposed this in https://github.com/WebKit/WebKit/pull/51490.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2147020</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2025-09-29 18:14:23 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #6)
&gt; WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS checks whether the flag is supported or
&gt; not, so it&apos;s safe to use it unconditionally. Ross proposed this in
&gt; https://github.com/WebKit/WebKit/pull/51490.

That’s neat.

Maybe we should turn off this warning immediately using WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS and then turn the warning back on while patching all the call sites to adapt to it. No reason we have to choose, we can do both!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2148519</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-10-05 00:09:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/161980988&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>