apache / apache/pulsar-client-cpp

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

オープン
#449 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
71
フォーク
90
平均マージ
2時間 33分
マージ済み PR(30日)
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 を短くまとめたダイジェスト。