apache / apache/pulsar-client-cpp

[Bug] Build fails on 32-bit platforms: overflow in expression; result is -64771072 with type 'long'

未關閉
#449 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
71
分支
90
平均合併
2 小時 33 分鐘
30 天內合併 PR
3

描述

### 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!

貢獻指南

開啟貢獻指南

研究方向

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.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
cpp
領域
build-system
Issue 類型
缺陷
難度
1/5
預估耗時
1 小時以內
活躍度
停滯
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。