diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-28 18:13:58 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-28 18:13:58 -0700 |
commit | 5cc2c2182332cd17bf12e3cdb58e61d0582eafc1 (patch) | |
tree | 0cae182fae1060f2aad53b0f1a756194e961c16e /src/support/file.cpp | |
parent | 5c1d36fb66b5aad63b02ab44433af201d22eebe0 (diff) | |
download | binaryen-5cc2c2182332cd17bf12e3cdb58e61d0582eafc1.tar.gz binaryen-5cc2c2182332cd17bf12e3cdb58e61d0582eafc1.tar.bz2 binaryen-5cc2c2182332cd17bf12e3cdb58e61d0582eafc1.zip |
streampos may be signed on some platforms
Diffstat (limited to 'src/support/file.cpp')
-rw-r--r-- | src/support/file.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/support/file.cpp b/src/support/file.cpp index da7054f7f..c93086990 100644 --- a/src/support/file.cpp +++ b/src/support/file.cpp @@ -29,12 +29,12 @@ T wasm::read_file(const std::string &filename, bool debug) { } infile.seekg(0, std::ios::end); std::streampos insize = infile.tellg(); - if (insize >= std::numeric_limits<size_t>::max()) { + if (size_t(insize) >= std::numeric_limits<size_t>::max()) { // Building a 32-bit executable where size_t == 32 bits, we are not able to create strings larger than 2^32 bytes in length, so must abort here. std::cerr << "Failed opening '" << filename << "': Input file too large: " << insize << " bytes. Try rebuilding in 64-bit mode." << std::endl; exit(EXIT_FAILURE); } - T input((size_t)insize + 1, '\0'); + T input(size_t(insize) + 1, '\0'); infile.seekg(0); infile.read(&input[0], insize); return input; |