Bug 178544 - -Wsign-compare triggered by MallocBench
Summary: -Wsign-compare triggered by MallocBench
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-19 14:20 PDT by Michael Catanzaro
Modified: 2017-11-15 13:01 PST (History)
8 users (show)

See Also:


Attachments
Patch (1.33 KB, patch)
2017-10-19 14:22 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2017-10-19 14:20:40 PDT
I see a warning now that MallocBench is enabled for Linux:

In file included from ../../PerformanceTests/MallocBench/MallocBench/Interpreter.cpp:28:0:
../../PerformanceTests/MallocBench/MallocBench/Interpreter.cpp: In constructor ‘Interpreter::Interpreter(const char*, bool, bool)’:
../../PerformanceTests/MallocBench/MallocBench/Interpreter.cpp:64:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     assert(m_opCount * sizeof(Op) == buf.st_size);
            ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

buf.st_size is an off_t, which is signed, so I think we should do static_cast<size_t>(buf.st_size).
Comment 1 Michael Catanzaro 2017-10-19 14:22:55 PDT
Created attachment 324284 [details]
Patch
Comment 2 WebKit Commit Bot 2017-10-19 18:48:00 PDT
Comment on attachment 324284 [details]
Patch

Clearing flags on attachment: 324284

Committed r223733: <https://trac.webkit.org/changeset/223733>
Comment 3 WebKit Commit Bot 2017-10-19 18:48:02 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2017-11-15 13:01:39 PST
<rdar://problem/35568633>