Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

fix: g_gas_price constant is too large for its type #175

Merged
merged 2 commits into from
Aug 17, 2022
Merged

Conversation

Flouse
Copy link
Collaborator

@Flouse Flouse commented Aug 13, 2022

GCC interpretes literal constants as 64 bits integers.

warning: integer constant is too large for its type static uint128_t g_gas_price = 0xffffffffffffffffffffffffffffffffu;

=>

UINT128_MAX = uint128_t(__int128_t(-1L))
= 340282366920938463463374607431768211455
= 0xffffffffffffffffffffffffffffffffu

@Flouse Flouse requested review from jjyr, magicalne and zeroqn August 13, 2022 13:18
@Flouse Flouse self-assigned this Aug 13, 2022
@Flouse Flouse changed the title fix(warning): g_gas_price constant is too large for its type fix: g_gas_price constant is too large for its type Aug 13, 2022
Flouse added 2 commits August 13, 2022 21:41
GCC interpretes literal constants as 64 bits integers.

> warning: integer constant is too large for its type static uint128_t g_gas_price = 0xffffffffffffffffffffffffffffffffu;

=>

UINT128_MAX = uint128_t(__int128_t(-1L))
= 340282366920938463463374607431768211455
= 0xffffffffffffffffffffffffffffffffu
@Flouse Flouse merged commit f1c4ee8 into main Aug 17, 2022
@Flouse Flouse deleted the fix-UINT128_MAX branch August 17, 2022 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants