-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix msgpack_cpp11 tests on 32-bit architectures #829
Conversation
CI / Linux (1) shows the same failure now:
|
|
42cbc3d
to
36c2032
Compare
You added I expected that if I define I will apply your fix for Line 58 in 4a94f83
instead of applying your This covers 64bit CXX11 at the pattern 2 and 32bit CXX11 at the pattern 3. It that OK? |
Yeah, I was trying to avoid expanding the matrix more. I can understand not wanting to take that change.
Sounds good. I'll remove the gha.yml change from this branch. |
On 32-bit unix platforms, 0xffffffffUL is a 32-bit value so the compiler complains about converting it to a signed value. /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: error: constant expression evaluates to 4294967295 which cannot be narrowed to type '__time_t' (aka 'long') [-Wc++11-narrowing] timespec val1{ 0xffffffffUL, 0 }; ^~~~~~~~~~~~ /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: note: insert an explicit cast to silence this issue timespec val1{ 0xffffffffUL, 0 }; ^~~~~~~~~~~~ static_cast<__time_t>( ) /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: warning: implicit conversion changes signedness: 'unsigned long' to '__time_t' (aka 'long') [-Wsign-conversion] timespec val1{ 0xffffffffUL, 0 }; ~ ^~~~~~~~~~~~ Since we're trying to test how the maximum 32-bit value that fits in timespec.tv_sec is handled, directly use the maximum 32-bit value for the appropriate (un)signed type used for timespec.tv_sec. We don't just cast to the value, as the compiler suggests, because that would result in an extremely negative value.
@jamessan , thank you. merged. |
I recently updated the Debian package for msgpack-c to 3.2.1 and found that there were a number of build failures. It appears that all of the 32-bit architectures (except m68k) failed with this error:
Since this test is only run as part of the c++11 suite, I created this PR to ensure there's c++11 coverage (both 64 and 32-bit) for the CI runs.
Please let me know if you'd rather add two new jobs to the matrix rather than re-purposing existing ones.