Bug 162552 - -Wformat warnings triggered by BitmapImage::frameImageAtIndex
Summary: -Wformat warnings triggered by BitmapImage::frameImageAtIndex
Status: RESOLVED DUPLICATE of bug 162596
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Minor
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-26 01:57 PDT by Michael Catanzaro
Modified: 2016-10-07 02:35 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.13 KB, patch)
2016-09-26 02:00 PDT, Michael Catanzaro
darin: review+
commit-queue: commit-queue-
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-26 01:57:56 PDT
Fix -Wformat warnings triggered by BitmapImage::frameImageAtIndex
Comment 1 Michael Catanzaro 2016-09-26 01:58:26 PDT
Should probably include the warning here:

[3923/6045] Building CXX object Source...ir/platform/graphics/BitmapImage.cpp.o
In file included from ../../Source/WTF/wtf/StdLibExtras.h:33:0,
                 from ../../Source/WTF/wtf/FastMalloc.h:26,
                 from ../../Source/WebCore/config.h:75,
                 from ../../Source/WebCore/platform/graphics/BitmapImage.cpp:27:
../../Source/WebCore/platform/graphics/BitmapImage.cpp: In member function ‘WebCore::NativeImagePtr WebCore::BitmapImage::frameImageAtIndex(size_t, float)’:
../../Source/WTF/wtf/Assertions.h:394:68: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘WebCore::SubsamplingLevel’ [-Wformat=]
 #define LOG(channel, ...) WTFLog(&LOG_CHANNEL(channel), __VA_ARGS__)
                                                                    ^
../../Source/WebCore/platform/graphics/BitmapImage.cpp:351:5: note: in expansion of macro ‘LOG’
     LOG(Images, "BitmapImage %p frameImageAtIndex - subsamplingLevel %d at scale %.4f", this, subsamplingLevel, presentationScaleHint);
     ^~~
../../Source/WTF/wtf/Assertions.h:394:68: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘WebCore::SubsamplingLevel’ [-Wformat=]
 #define LOG(channel, ...) WTFLog(&LOG_CHANNEL(channel), __VA_ARGS__)
                                                                    ^
../../Source/WebCore/platform/graphics/BitmapImage.cpp:356:9: note: in expansion of macro ‘LOG’
         LOG(Images, "  subsamplingLevel was %d, resampling", m_frames[index].subsamplingLevel());
         ^~~
Comment 2 Michael Catanzaro 2016-09-26 02:00:53 PDT
Created attachment 289811 [details]
Patch
Comment 3 Alex Christensen 2016-09-26 08:20:28 PDT
Comment on attachment 289811 [details]
Patch

Couldn't we just change the %d to %zu?
Comment 4 Michael Catanzaro 2016-09-26 11:43:53 PDT
(In reply to comment #3)
> Comment on attachment 289811 [details]
> Patch
> 
> Couldn't we just change the %d to %zu?

No that doesn't make sense, WebCore::SubsamplingLevel is an enum and it doesn't specify any particular backing data type, so it's an int and %d is the right way to print it.
Comment 5 Michael Catanzaro 2016-10-04 11:35:12 PDT
Ping reviewers
Comment 6 WebKit Commit Bot 2016-10-06 20:24:29 PDT
Comment on attachment 289811 [details]
Patch

Rejecting attachment 289811 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 289811, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
]" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Parsed 2 diffs from patch file(s).
patching file Source/WebCore/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/WebCore/platform/graphics/BitmapImage.cpp
Hunk #1 FAILED at 348.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebCore/platform/graphics/BitmapImage.cpp.rej

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Darin Adler']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/2235068
Comment 7 Michael Catanzaro 2016-10-07 02:35:44 PDT
It's already fixed.

*** This bug has been marked as a duplicate of bug 162596 ***