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

proc_stat_test.go: architecture dependent MinInt and MaxInt constants #437

Closed
wants to merge 1 commit into from

Conversation

TimRots
Copy link

@TimRots TimRots commented Mar 9, 2022

to avoid math.MinInt64 and math.MaxInt64 overflowing int type
when running TestProcStatLimits on 32bit architectures:

./proc_stat_test.go:97:49: cannot use math.MinInt64 (untyped int constant -9223372036854775808) as int value in struct literal (overflows)
./proc_stat_test.go:98:51: cannot use math.MaxInt64 (untyped int constant 9223372036854775807) as int value in struct literal (overflows)

Fixes: #432

Signed-off-by: Tim Rots [email protected]

to avoid `math.MinInt64` and `math.MaxInt64` overflowing `int` type
when running `TestProcStatLimits` on 32bit architectures:
```
./proc_stat_test.go:97:49: cannot use math.MinInt64 (untyped int constant -9223372036854775808) as int value in struct literal (overflows)
./proc_stat_test.go:98:51: cannot use math.MaxInt64 (untyped int constant 9223372036854775807) as int value in struct literal (overflows)
```

Fixes: prometheus#432

Signed-off-by: Tim Rots <[email protected]>
@discordianfish
Copy link
Member

Hrmm how is this working with the fixture having the same values on all archs?

@TimRots
Copy link
Author

TimRots commented May 9, 2022

I clearly didn't understand the issue. Sorry for this

@TimRots TimRots closed this May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestProcStatLimits: Int overflow on 32 bits arches
2 participants