<?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>189496</bug_id>
          
          <creation_ts>2018-09-11 02:22:17 -0700</creation_ts>
          <short_desc>[Win][Clang][ImageDiff] Fix compilation error and warning of PlatformImageCairo.cpp</short_desc>
          <delta_ts>2018-09-12 19:05:22 -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>Tools / Tests</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="Fujii Hironori">fujii</reporter>
          <assigned_to name="Fujii Hironori">fujii</assigned_to>
          <cc>achristensen</cc>
    
    <cc>don.olmstead</cc>
    
    <cc>fred.wang</cc>
    
    <cc>lforschler</cc>
    
    <cc>pvollan</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1458431</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 02:22:17 -0700</bug_when>
    <thetext>[Win][Clang][ImageDiff] Fix compilation error and warning of PlatformImageCairo.cpp

While trying to build WebKit WinCairo port with the latest Clang (Bug 171618),
the following compilation error and warning is reported.

&gt; [2/1360] Building CXX object Tools\ImageDiff\CMakeFiles\ImageDiffLib.dir\cairo\PlatformImageCairo.cpp.obj
&gt; FAILED: Tools/ImageDiff/CMakeFiles/ImageDiffLib.dir/cairo/PlatformImageCairo.cpp.obj 
&gt; C:\tools\llvm\bin\clang-cl.exe  (...) /FdTools\ImageDiff\CMakeFiles\ImageDiffLib.dir\ -c ..\..\Tools\ImageDiff\cairo\PlatformImageCairo.cpp
&gt; ..\..\Tools\ImageDiff\cairo\PlatformImageCairo.cpp(46,22):  error: non-constant-expression cannot be narrowed from type &apos;size_t&apos; (aka &apos;unsigned long long&apos;) to &apos;unsigned long&apos; in initializer list [-Wc++11-narrowing]
&gt;     } context { { }, imageSize, 0 };
&gt;                      ^~~~~~~~~
&gt; ..\..\Tools\ImageDiff\cairo\PlatformImageCairo.cpp(46,22):  note: insert an explicit cast to silence this issue
&gt;     } context { { }, imageSize, 0 };
&gt;                      ^~~~~~~~~
&gt;                      static_cast&lt;unsigned long&gt;( )
&gt; ..\..\Tools\ImageDiff\cairo\PlatformImageCairo.cpp(125,61):  warning: format specifies type &apos;unsigned __int64&apos; (aka &apos;unsigned long long&apos;) but the argument has type &apos;unsigned long&apos; [-Wformat]
&gt;     fprintf(stdout, &quot;Content-Length: %&quot; FORMAT_SIZE_T &quot;\n&quot;, context.writtenBytes);
&gt;                                      ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~
&gt; 1 warning and 1 error generated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458434</commentid>
    <comment_count>1</comment_count>
      <attachid>349389</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 02:38:47 -0700</bug_when>
    <thetext>Created attachment 349389
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458488</commentid>
    <comment_count>2</comment_count>
    <who name="Don Olmstead">don.olmstead</who>
    <bug_when>2018-09-11 09:47:57 -0700</bug_when>
    <thetext>Informal r+ from me. Will look for a formal review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458612</commentid>
    <comment_count>3</comment_count>
      <attachid>349389</attachid>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2018-09-11 13:14:10 -0700</bug_when>
    <thetext>Comment on attachment 349389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=349389&amp;action=review

&gt; Tools/ImageDiff/cairo/PlatformImageCairo.cpp:40
&gt; -        }, &amp;context);
&gt; +        }, nullptr);

Can this parameter be nullptr? I think this is passed to the read function in the first parameter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458831</commentid>
    <comment_count>4</comment_count>
      <attachid>349389</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 19:18:09 -0700</bug_when>
    <thetext>Comment on attachment 349389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=349389&amp;action=review

&gt;&gt; Tools/ImageDiff/cairo/PlatformImageCairo.cpp:40
&gt;&gt; +        }, nullptr);
&gt; 
&gt; Can this parameter be nullptr? I think this is passed to the read function in the first parameter.

I don&apos;t understand. I removed the unnecessary first argument.

This is the spec.
https://www.cairographics.org/manual/cairo-PNG-Support.html#cairo-read-func-t</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458835</commentid>
    <comment_count>5</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 19:30:12 -0700</bug_when>
    <thetext>Just for the record. MSVC also reports following warnings in this source file:

&gt; 10&gt;c:\webkit\ga\tools\imagediff\cairo\platformimagecairo.cpp(46): warning C4838: conversion from &apos;size_t&apos; to &apos;unsigned long&apos; requires a narrowing conversion
&gt; 10&gt;c:\webkit\ga\tools\imagediff\cairo\platformimagecairo.cpp(125): warning C4477: &apos;fprintf&apos; : format string &apos;%Iu&apos; requires an argument of type &apos;unsigned __int64&apos;, but variadic argument 1 has type &apos;unsigned long&apos;
&gt; 10&gt;c:\webkit\ga\tools\imagediff\cairo\platformimagecairo.cpp(125): note: consider using &apos;%lu&apos; in the format string</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458867</commentid>
    <comment_count>6</comment_count>
      <attachid>349389</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 21:50:54 -0700</bug_when>
    <thetext>Comment on attachment 349389
Patch

Clearing flags on attachment: 349389

Committed r235929: &lt;https://trac.webkit.org/changeset/235929&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458868</commentid>
    <comment_count>7</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 21:50:57 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458869</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-09-11 21:51:28 -0700</bug_when>
    <thetext>&lt;rdar://problem/44370981&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458961</commentid>
    <comment_count>9</comment_count>
      <attachid>349389</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2018-09-12 09:01:19 -0700</bug_when>
    <thetext>Comment on attachment 349389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=349389&amp;action=review

&gt;&gt;&gt; Tools/ImageDiff/cairo/PlatformImageCairo.cpp:40
&gt;&gt;&gt; +        }, nullptr);
&gt;&gt; 
&gt;&gt; Can this parameter be nullptr? I think this is passed to the read function in the first parameter.
&gt; 
&gt; I don&apos;t understand. I removed the unnecessary first argument.
&gt; 
&gt; This is the spec.
&gt; https://www.cairographics.org/manual/cairo-PNG-Support.html#cairo-read-func-t

Note that this is causing compilation warning now that imageSize is unused. I think you can just write &quot;PlatformImage::createFromStdin(size_t)&quot; now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1459073</commentid>
    <comment_count>10</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-12 13:43:14 -0700</bug_when>
    <thetext>Thank you for letting me know. I will fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1459223</commentid>
    <comment_count>11</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-12 19:05:22 -0700</bug_when>
    <thetext>Committed r235965: &lt;https://trac.webkit.org/changeset/235965&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>349389</attachid>
            <date>2018-09-11 02:38:47 -0700</date>
            <delta_ts>2018-09-11 21:50:54 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-189496-20180911183846.patch</filename>
            <type>text/plain</type>
            <size>2791</size>
            <attacher name="Fujii Hironori">fujii</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjM1ODg2CmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggN2ExNzk2NTNiYjVjOTNkNjc5OTk5MWE0NmM2MTFmZWM0
ZjMyOWI5ZC4uNTAzMmE4NTk2Y2RjZTBjMTZiYjdlNDA2Y2EwZTE2ODk1ZGExNTEyNSAxMDA2NDQK
LS0tIGEvVG9vbHMvQ2hhbmdlTG9nCisrKyBiL1Rvb2xzL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE0
IEBACisyMDE4LTA5LTExICBGdWppaSBIaXJvbm9yaSAgPEhpcm9ub3JpLkZ1amlpQHNvbnkuY29t
PgorCisgICAgICAgIFtXaW5dW0NsYW5nXVtJbWFnZURpZmZdIEZpeCBjb21waWxhdGlvbiBlcnJv
ciBhbmQgd2FybmluZyBvZiBQbGF0Zm9ybUltYWdlQ2Fpcm8uY3BwCisgICAgICAgIGh0dHBzOi8v
YnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xODk0OTYKKworICAgICAgICBSZXZpZXdl
ZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICAqIEltYWdlRGlmZi9jYWlyby9QbGF0Zm9y
bUltYWdlQ2Fpc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