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

Use ULL (unsigned long long) suffixes in generated encoding.h file #173

Open
JanMatCodasip opened this issue Apr 13, 2023 · 2 comments
Open

Comments

@JanMatCodasip
Copy link
Contributor

JanMatCodasip commented Apr 13, 2023

Improvement suggestion (merely a note to self):

The integer literals in the generated encoding.out.h C header file should contain ULL suffixes (unsigned long long) when the actual value exceeds 64 bits.

This improvement has been requested in OpenOCD project which utilizes this generated .h file: https://review.openocd.org/c/openocd/+/7600

@aswaterman
Copy link
Member

This is a reasonable request, but whoever handles it needs to do it in such a way that the constants can still be used in assembly code, where the ULL suffix will cause a parse error. See e.g. how the Linux kernel does this: https://github.com/torvalds/linux/blob/de4664485abbc0529b1eec44d0061bbfe58a28fb/include/uapi/linux/const.h#L7

@JanMatCodasip
Copy link
Contributor Author

... whoever handles it needs to do it in such a way that the constants can still be used in assembly code, where the ULL suffix will cause a parse error ...

@aswaterman, thank you for pointing this out and for the link. I will keep that in mind when making the change.

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

No branches or pull requests

2 participants