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

Add UtAssert_SIZET_EQ #1359

Closed
jphickey opened this issue Feb 1, 2023 · 0 comments · Fixed by #1375
Closed

Add UtAssert_SIZET_EQ #1359

jphickey opened this issue Feb 1, 2023 · 0 comments · Fixed by #1375

Comments

@jphickey
Copy link
Contributor

jphickey commented Feb 1, 2023

Is your feature request related to a problem? Please describe.
In many cases the code uses UtAssert_UINT32_EQ to check values that are actually size_t in the implementation. This is mostly OK as long as the sizes are <4GiB, which is almost always the case on flight systems that usually don't have a lot of memory.

Describe the solution you'd like
To support larger systems in the future, UT assert should have a macro that compares size_t values natively without converting down to uint32 first.

Describe alternatives you've considered
Continue using uint32 comparisons, accept limitation that this cannot be used for objects/sizes greater than 4GiB.

Additional context
Intent is to be proactive, this will probably become a limiting factor to somebody at some point. Plus it is more correct to be able to compare size_t values in a type-safe manner.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Feb 2, 2023
jphickey added a commit to jphickey/osal that referenced this issue Mar 14, 2023
Adds generic macros for asserting on integer values that can work with
any integer data type, including size_t and 64-bit values where needed.
jphickey added a commit to jphickey/osal that referenced this issue Mar 14, 2023
Adds generic macros for asserting on integer values that can work with
any integer data type, including size_t and 64-bit values where needed.
dzbaker added a commit that referenced this issue Mar 16, 2023
Fix #1359, add assert macros for other data types
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants