Bug 191416 - [Win] UDis86Disassembler.cpp: warning: format specifies type 'unsigned long' but the argument has type 'uintptr_t' (aka 'unsigned long long')
Summary: [Win] UDis86Disassembler.cpp: warning: format specifies type 'unsigned long' ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-08 00:24 PST by Fujii Hironori
Modified: 2018-11-08 17:31 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.68 KB, patch)
2018-11-08 01:18 PST, 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 2018-11-08 00:24:02 PST
[Win] UDis86Disassembler.cpp: warning: format specifies type 'unsigned long' but the argument has type 'uintptr_t' (aka 'unsigned long long')

MSVC reports following compilation warning:

> c:\webkit\ga\source\javascriptcore\disassembler\udis86disassembler.cpp(52): warning C4477: 'snprintf' : format string '%lx' requires an argument of type 'unsigned long', but variadic argument 1 has type 'uintptr_t' (compiling source file C:\webkit\ga\WebKitBuild\Debug\DerivedSources\JavaScriptCore\unified-sources\UnifiedSource55.cpp)
> c:\webkit\ga\source\javascriptcore\disassembler\udis86disassembler.cpp(52): note: consider using '%llx' in the format string (compiling source file C:\webkit\ga\WebKitBuild\Debug\DerivedSources\JavaScriptCore\unified-sources\UnifiedSource55.cpp)
> c:\webkit\ga\source\javascriptcore\disassembler\udis86disassembler.cpp(52): note: consider using '%Ix' in the format string (compiling source file C:\webkit\ga\WebKitBuild\Debug\DerivedSources\JavaScriptCore\unified-sources\UnifiedSource55.cpp)
> c:\webkit\ga\source\javascriptcore\disassembler\udis86disassembler.cpp(52): note: consider using '%I64x' in the format string (compiling source file C:\webkit\ga\WebKitBuild\Debug\DerivedSources\JavaScriptCore\unified-sources\UnifiedSource55.cpp)

Clang-cl reports following compilation warning:

> In file included from DerivedSources\JavaScriptCore\unified-sources\UnifiedSource55.cpp:4:
> ..\..\Source\JavaScriptCore\disassembler/UDis86Disassembler.cpp(52,55):  warning: format specifies type 'unsigned long' but the argument has type 'uintptr_t' (aka 'unsigned long long') [-Wformat]
>         snprintf(pcString, sizeof(pcString), "0x%lx", static_cast<uintptr_t>(currentPC));
>                                                 ~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                                                 %llx
> 1 warning generated.

This code has been introduced in Bug 190273.
Comment 1 Fujii Hironori 2018-11-08 01:18:02 PST
Created attachment 354218 [details]
Patch
Comment 2 Fujii Hironori 2018-11-08 17:30:43 PST
Comment on attachment 354218 [details]
Patch

Clearing flags on attachment: 354218

Committed r238011: <https://trac.webkit.org/changeset/238011>
Comment 3 Fujii Hironori 2018-11-08 17:30:46 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2018-11-08 17:31:38 PST
<rdar://problem/45930615>