apache / apache/pulsar-client-cpp
[Bug] Build fails on 32-bit platforms: overflow in expression; result is -64771072 with type 'long'
- Ngôn ngữ chính
- C++
- Star
- 71
- Fork
- 90
- Merge trung bình
- 2 giờ 33 phút
- Pull request đã merge (30 ngày)
- 3
Mô tả
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing similar.
### Version
3.6.0
### Minimal reproduce step
build on 32-bit platform
### What did you expect to see?
n/a
### What did you see instead?
```
In file included from /wrkdirs/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.6.0/lib/ClientConfiguration.cc:22:
/wrkdirs/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.6.0/lib/ClientConfigurationImpl.h:33:65: error: overflow in expression; result is -64771072 with type 'long' [-Werror,-Winteger-overflow]
33 | std::chrono::nanoseconds operationTimeout{30L * 1000 * 1000 * 1000};
| ~~~~~~~~~~~~~~~~~~^~~~~~
/wrkdirs/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.6.0/lib/ClientConfigurationImpl.h:33:65: error: overflow in expression; result is -64771072 with type 'long' [-Werror,-Winteger-overflow]
33 | std::chrono::nanoseconds operationTimeout{30L * 1000 * 1000 * 1000};
| ~~~~~~~~~~~~~~~~~~^~~~~~
2 errors generated.
```
### Anything else?
[log](https://pkg-status.freebsd.org/beefy17/data/main-i386-default/pe65c3d3818f0_s74f6ec6fe3c/logs/pulsar-client-cpp-3.6.0.log)
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with lib/ClientConfigurationImpl.h at the operationTimeout initializer on line 33 and review the linked FreeBSD 32-bit build log. Verify the correction by building pulsar-client-cpp 3.6.0 on a 32-bit platform and confirming the integer-overflow error no longer occurs.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- build-system
- Loại issue
- Lỗi
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 45/100