-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix FW_COMMIT_HASH
compiler warning
#4432
Conversation
On my end, the default length for the abbreviated commit hash is 9 characters. This won't fit into uint32_t (4 bytes). Instead change FW_COMMIT_HASH into a string and create preprocessor symbol for the string length such that it's known at compile time. If the string should be longer or shorter then only FW_COMMIT_HASH_LENGTH needs to be configured on the CMake side
The function |
All values in bytes. Δ Delta to base
|
@vintagepc the last commit seems to have resolved the static assert :) There is still an issue with the Github Action. The runner doesn't detect I've tried to run the Workflow via Docker on Windows using https://github.com/nektos/act but no luck so far. |
The command /usr/bin/git describe --abbrev=0 --dirty=-D --broken=-B Was returning error code 128 and no output. In the workflow file, specifying fetch-depth = 0, will make sure to fetch all branches and tags. This seems to fix the issue.
We can shorten the hash to 8 chars with |
Note that I think having the data as a string ( |
Okay. Is the other comment resolved? |
Yeah 69e06ba resolved it. Github always failed to build before that fix because I added a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works well. No warnings.
@vintagepc Can we merge it? |
On my end, the default length for the abbreviated commit hash is 9 characters and won't fit into
uint32_t
.To fix this I propose to change
FW_COMMIT_HASH
into a string and create preprocessor symbol for the string length so that it's known at compile time.If the string should be longer or shorter then only
FW_COMMIT_HASH_LENGTH
needs to be configured on the CMake side