<?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>195004</bug_id>
          
          <creation_ts>2019-02-25 07:29:51 -0800</creation_ts>
          <short_desc>-Wformat error in SharedBuffer::tryCreateArrayBuffer</short_desc>
          <delta_ts>2019-03-03 08:45:45 -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>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1509626</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-25 07:29:51 -0800</bug_when>
    <thetext>Looking over a 32-bit build log from Debian, to check for potential issues with 32-bit build:

/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/PAL/pal/FileSizeFormatter.cpp: In function &apos;WTF::String fileSizeDescription(uint64_t)&apos;:
/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/PAL/pal/FileSizeFormatter.cpp:36:31: warning: format &apos;%tu&apos; expects argument of type &apos;unsigned ptrdiff_t&apos;, but argument 2 has type &apos;uint64_t&apos; {aka &apos;long long unsigned int&apos;} [-Wformat=]
         return String::format(&quot;%tu bytes&quot;, size);
                               ^~~~~~~~~~~  ~~~~

In file included from /&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-i686-linux-gnu/DerivedSources/WebCore/unified-sources/UnifiedSource291.cpp:1:
/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp: In function &apos;WTF::String WebCore::formatByteNumber(size_t)&apos;:
/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp:59:27: warning: format &apos;%lu&apos; expects argument of type &apos;long unsigned int&apos;, but argument 2 has type &apos;size_t&apos; {aka &apos;unsigned int&apos;} [-Wformat=]
     return String::format(&quot;%lu&quot;, number);
                           ^~~~~  ~~~~~~

In file included from /&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-i686-linux-gnu/DerivedSources/WebCore/unified-sources/UnifiedSource300.cpp:5:
/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/platform/SharedBuffer.cpp: In member function &apos;WTF::RefPtr&lt;JSC::ArrayBuffer&gt; WebCore::SharedBuffer::tryCreateArrayBuffer() const&apos;:
/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/platform/SharedBuffer.cpp:124:22: warning: format &apos;%lu&apos; expects argument of type &apos;long unsigned int&apos;, but argument 3 has type &apos;unsigned int&apos; [-Wformat=]
         WTFLogAlways(&quot;SharedBuffer::tryCreateArrayBuffer Unable to create buffer. Requested size was %zu x %lu\n&quot;, size(), sizeof(char));
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1509627</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-25 07:30:51 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; Looking over a 32-bit build log from Debian, to check for potential issues
&gt; with 32-bit build:
&gt; 
&gt; /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/PAL/pal/FileSizeFormatter.cpp: In function
&gt; &apos;WTF::String fileSizeDescription(uint64_t)&apos;:
&gt; /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/PAL/pal/FileSizeFormatter.cpp:36:31:
&gt; warning: format &apos;%tu&apos; expects argument of type &apos;unsigned ptrdiff_t&apos;, but
&gt; argument 2 has type &apos;uint64_t&apos; {aka &apos;long long unsigned int&apos;} [-Wformat=]
&gt;          return String::format(&quot;%tu bytes&quot;, size);
&gt;                                ^~~~~~~~~~~  ~~~~

This one&apos;s already fixed (probably by Darin).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1509628</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-25 07:31:57 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; In file included from
&gt; /&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-i686-linux-gnu/DerivedSources/WebCore/unified-sources/
&gt; UnifiedSource291.cpp:1:
&gt; /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp: In
&gt; function &apos;WTF::String WebCore::formatByteNumber(size_t)&apos;:
&gt; /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp:59:
&gt; 27: warning: format &apos;%lu&apos; expects argument of type &apos;long unsigned int&apos;, but
&gt; argument 2 has type &apos;size_t&apos; {aka &apos;unsigned int&apos;} [-Wformat=]
&gt;      return String::format(&quot;%lu&quot;, number);
&gt;                            ^~~~~  ~~~~~~

Ditto</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1509630</commentid>
    <comment_count>3</comment_count>
      <attachid>362903</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-25 07:43:14 -0800</bug_when>
    <thetext>Created attachment 362903
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511920</commentid>
    <comment_count>4</comment_count>
      <attachid>362903</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-03-03 00:31:08 -0800</bug_when>
    <thetext>Comment on attachment 362903
Patch

This seems fine. if we did need to log the result of sizeof there are three traditional fixes:

1) add a type cast to some known type
2) put in a local variable or constant of a known type
3) stringify the constant into the literal directly rather than using printf formatting to insert it</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511938</commentid>
    <comment_count>5</comment_count>
      <attachid>362903</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-03-03 08:45:43 -0800</bug_when>
    <thetext>Comment on attachment 362903
Patch

Clearing flags on attachment: 362903

Committed r242327: &lt;https://trac.webkit.org/changeset/242327&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511939</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-03-03 08:45:45 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>362903</attachid>
            <date>2019-02-25 07:43:14 -0800</date>
            <delta_ts>2019-03-03 08:45:43 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-195004-20190225094313.patch</filename>
            <type>text/plain</type>
            <size>2119</size>
            <attacher name="Michael Catanzaro">mcatanzaro</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQyMDM4CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cg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