serge1 / ELFIO

ELFIO - ELF (Executable and Linkable Format) reader and producer implemented as a header only C++ library
http://serge1.github.io/ELFIO
MIT License
706 stars 152 forks source link

Respect maximum value of size_t in set_stream_size #88

Closed Matthew-McRaven closed 2 years ago

Matthew-McRaven commented 2 years ago

When size_t is 32-bits (like in a WASM project), passing in a 64-bit constant leads to compile-time warnings.

This resolves #85 using the second method I suggested: passing a value of std::numeric_limits<size_t>::max() to set_stream_size (see reference).

I ran the contents of your CI test script locally:

cd tests
./configure
make
make check

The tests appeared to pass.

Please let me know if you have any questions or concerns, Matthew

serge1 commented 2 years ago

Accepted and merged. Thank you!