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

unit tests: fix pointer casts on 32 bit systems. #2765

Conversation

JuergenReppSIT
Copy link
Member

Conversions of max uint64 numbers to pointers did produce compile errors on 32bit systems. A cast to size_t is now added before the casting to a pointer.

Conversions of max uint64 numbers to pointers did produce compile
errors on 32bit systems. A cast to size_t is now added before the
casting to a pointer.

Signed-off-by: Juergen Repp <[email protected]>
@AndreasFuchsTPM
Copy link
Member

What exactly was the error message ?
Because this seems kind of ugly...

@JuergenReppSIT
Copy link
Member Author

What exactly was the error message ? Because this seems kind of ugly...
the error message was:

test/unit/tcti-spidev.c:111:23: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  111 |     uint8_t *tx_buf = (uint8_t *) tr->tx_buf;
  

tx_buf had the type __u64. Yes it's ugly. Do you have a better suggestion?

@AndreasFuchsTPM AndreasFuchsTPM merged commit 48ce2d4 into tpm2-software:master Feb 7, 2024
25 checks passed
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.

2 participants