<?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>250684</bug_id>
          
          <creation_ts>2023-01-16 09:33:36 -0800</creation_ts>
          <short_desc>[ANGLE] Fix -Wsign-compare warnings on watchOS</short_desc>
          <delta_ts>2023-01-29 21:33:26 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>ANGLE</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>dino</cc>
    
    <cc>kbr</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1925835</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2023-01-16 09:33:36 -0800</bug_when>
    <thetext>Fix -Wsign-compare warnings on watchOS.

On watchOS, &apos;GLintptr&apos; is defined as &apos;long&apos;, so comparing to &apos;std::numeric_limits&lt;uint32_t&gt;::max()&apos; results in a signed/unsigned comparison:

/Volumes/Data/worker/watchOS-9-Build-EWS/build/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm:1095:57: error: comparison of integers of different signs: &apos;GLintptr&apos; (aka &apos;long&apos;) and &apos;std::numeric_limits&lt;unsigned int&gt;::type&apos; (aka &apos;unsigned int&apos;) [-Werror,-Wsign-compare]
    ANGLE_CHECK_GL_MATH(contextMtl, binding.getOffset() &lt;= std::numeric_limits&lt;uint32_t&gt;::max());
                                    ~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Volumes/Data/worker/watchOS-9-Build-EWS/build/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm:10:
In file included from src/libANGLE/renderer/metal/VertexArrayMtl.h:13:
In file included from src/libANGLE/renderer/VertexArrayImpl.h:12:
src/common/angleutils.h:470:26: note: expanded from macro &apos;ANGLE_CHECK_GL_MATH&apos;
    ANGLE_CHECK(context, result, &quot;Integer overflow.&quot;, GL_INVALID_OPERATION)
                         ^~~~~~
In file included from /Volumes/Data/worker/watchOS-9-Build-EWS/build/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm:10:
In file included from src/libANGLE/renderer/metal/VertexArrayMtl.h:13:
In file included from src/libANGLE/renderer/VertexArrayImpl.h:13:
In file included from src/libANGLE/Buffer.h:16:
In file included from src/libANGLE/Debug.h:16:
src/libANGLE/Error.h:153:30: note: expanded from macro &apos;ANGLE_CHECK&apos;
        if (ANGLE_UNLIKELY(!(EXPR)))                                                  \
                             ^~~~
In file included from /Volumes/Data/worker/watchOS-9-Build-EWS/build/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm:10:
In file included from src/libANGLE/renderer/metal/VertexArrayMtl.h:13:
In file included from src/libANGLE/renderer/VertexArrayImpl.h:12:
In file included from src/common/angleutils.h:12:
src/common/platform.h:123:55: note: expanded from macro &apos;ANGLE_UNLIKELY&apos;
#        define ANGLE_UNLIKELY(x) __builtin_expect(!!(x), 0)
                                                      ^</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925836</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-16 09:33:53 -0800</bug_when>
    <thetext>&lt;rdar://problem/104301662&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925839</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2023-01-16 09:57:25 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/8699</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925840</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2023-01-16 10:06:18 -0800</bug_when>
    <thetext>Another issue:

/Volumes/Data/worker/watchOS-9-Build-EWS/build/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm:1658:57: error: comparison of integers of different signs: &apos;const ptrdiff_t&apos; (aka &apos;const long&apos;) and &apos;std::numeric_limits&lt;unsigned int&gt;::type&apos; (aka &apos;unsigned int&apos;) [-Werror,-Wsign-compare]
    ANGLE_MTL_CHECK(contextMtl, packPixelsParams.offset &lt;= std::numeric_limits&lt;uint32_t&gt;::max(),
                                ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Volumes/Data/worker/watchOS-9-Build-EWS/build/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm:11:
In file included from src/libANGLE/renderer/metal/ContextMtl.h:19:
In file included from src/libANGLE/renderer/metal/ProvokingVertexHelper.h:16:
In file included from src/libANGLE/renderer/metal/DisplayMtl.h:16:
In file included from src/libANGLE/renderer/metal/mtl_command_buffer.h:27:
src/libANGLE/renderer/metal/mtl_common.h:564:30: note: expanded from macro &apos;ANGLE_MTL_CHECK&apos;
        if (ANGLE_UNLIKELY(!(test)))                                                           \
                             ^~~~
In file included from /Volumes/Data/worker/watchOS-9-Build-EWS/build/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm:10:
In file included from src/libANGLE/angletypes.h:13:
In file included from src/common/FixedVector.h:13:
In file included from src/common/debug.h:22:
In file included from src/common/angleutils.h:12:
src/common/platform.h:123:55: note: expanded from macro &apos;ANGLE_UNLIKELY&apos;
#        define ANGLE_UNLIKELY(x) __builtin_expect(!!(x), 0)
                                                      ^</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1929327</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-29 21:33:24 -0800</bug_when>
    <thetext>Committed 259542@main (076b5adb1937): &lt;https://commits.webkit.org/259542@main&gt;

Reviewed commits have been landed. Closing PR #8699 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>