Bug 232596 - ImageDiff.cpp(74): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 2 has type 'size_t'
Summary: ImageDiff.cpp(74): warning C4477: 'fprintf' : format string '%lu' requires an...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-01 17:06 PDT by Fujii Hironori
Modified: 2021-11-01 19:31 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.80 KB, patch)
2021-11-01 17:08 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-11-01 17:06:04 PDT
Since r284764, MSVC reports the following warning.

C:\home\webkit\gc\Tools\ImageDiff\ImageDiff.cpp(74): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 2 has type 'size_t'
C:\home\webkit\gc\Tools\ImageDiff\ImageDiff.cpp(74): note: consider using '%zu' in the format string
Comment 1 Fujii Hironori 2021-11-01 17:08:30 PDT
Created attachment 443037 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-11-01 17:38:40 PDT
Can we fix the style checker to catch this?
Comment 3 Fujii Hironori 2021-11-01 18:44:08 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Can we fix the style checker to catch this?

The style checker doesn't compile, doesn't know the type of variable.
AppleWin treats warning as error. But, unfortunately, it suppresses warnings introduced in Visual Studio 2013 (major version 18) and later. 

> add_compile_options(/WX /Wv:18)

https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level
Comment 4 EWS 2021-11-01 19:30:34 PDT
Committed r285150 (243787@main): <https://commits.webkit.org/243787@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 443037 [details].
Comment 5 Radar WebKit Bug Importer 2021-11-01 19:31:17 PDT
<rdar://problem/84911625>