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 摘要。