Hello,
While building tpm-tools, I see the following warning/error
tpm_nvcommon.c: In function ‘parseStringWithValues’:
tpm_nvcommon.c:167:31: warning: comparison of constant ‘124’ with boolean expression is always false [-Wbool-compare]
167 | if (!aArg[offset+numbytes] == '|' &&
| ^~
tpm_nvcommon.c:167:31: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
tpm_nvcommon.c:167:8: note: add parentheses around left hand side expression to silence this warning
167 | if (!aArg[offset+numbytes] == '|' &&
| ^~~~~~~~~~~~~~~~~~~~~~
| ( )
The comparison is indeed ambiguous and looks wrong
I see this commit: https://sourceforge.net/p/trousers/tpm-tools/ci/8f253fbc61b8afb6a5d341090bba31dada29dffd/ that fixed an other occurrence of this apparently
Edit: Is that patch actually correct?
Last edit: Laurent Bigonville 2021-06-10