Skip to content
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

build for windows_386 (untyped int constant) overflows int #219

Closed
iTanken opened this issue Jan 24, 2024 · 6 comments · Fixed by #220
Closed

build for windows_386 (untyped int constant) overflows int #219

iTanken opened this issue Jan 24, 2024 · 6 comments · Fixed by #220
Labels
Bug Report a reproducible bug or regression

Comments

@iTanken
Copy link
Contributor

iTanken commented Jan 24, 2024

Hello,

I encountered an issue with the following code:

github.com\golang-module\carbon\v2\calendar\lunar\lunar.go:161:31

golang version: 1.20.13

carbon version: 2.3.6

I expected to get:

exit status 0

But I actually get:

failed to build for windows_386: exit status 1: # github.com/golang-module/carbon/v2/calendar/lunar
vendor\github.com\golang-module\carbon\v2\calendar\lunar\lunar.go:161:31: -2206512000 (untyped int constant) overflows int

exit status 1

Thanks!

@iTanken iTanken added the Bug Report a reproducible bug or regression label Jan 24, 2024
@gouguoyin
Copy link
Collaborator

failed when install?

@iTanken
Copy link
Contributor Author

iTanken commented Jan 24, 2024

failed when install?

when building 32-bit programs

@gouguoyin
Copy link
Collaborator

安装时没问题,交叉编译时出错吗?

@Issues-translate-bot
Copy link
Collaborator

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


There is no problem during installation, but is there an error when cross-compiling?

@iTanken
Copy link
Contributor Author

iTanken commented Jan 24, 2024

安装时没问题,交叉编译时出错吗?

嗯,64 位编译运行没有问题,设置 GOARCH=386 编译 32 位程序的时候 lunar.go 第 161 行 int 溢出。

v2.3.5 在 32位环境下是编译运行正常的。

@Issues-translate-bot
Copy link
Collaborator

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


There is no problem during installation. Is there an error during cross compilation?

Well, there is no problem in 64-bit compilation and operation. When setting GOARCH=386 to compile a 32-bit program, int overflows in line 161 of lunar.go.

v2.3.5 compiles and runs normally in a 32-bit environment.

iTanken referenced this issue in iTanken/carbon Jan 25, 2024
Ref: golang-module/carbon/issues/219

Signed-off-by: liutianqi <zixizixi@vip.qq.com>
gouguoyin added a commit that referenced this issue Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report a reproducible bug or regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants