-
Notifications
You must be signed in to change notification settings - Fork 2k
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 some logging formats #7921
Fix some logging formats #7921
Conversation
Trying to log them as 16-bit integers fails on some compilers, since they are 8-bit.
59ab1cb
to
e3c96c0
Compare
For reference the format errors (hundreds of them in generated code) were caused by two lines in zap template, e.g. ../../../../../src/controller/data_model/gen/IMClusterCommandHandler.cpp:127:83: error: format specifies type 'unsigned short' but the argument has type 'chip::CommandId' (aka 'unsigned char') [-Werror,-Wformat] ../../../../../examples/chip-tool/commands/clusters/Commands.h:1213:99: error: format specifies type 'unsigned short' but the argument has type 'uint8_t' (aka 'unsigned char') [-Werror,-Wformat] Confirming that the PR fixes the errors. |
You can reproduce the build failure with any version of llvm/clang, e.g. edit examples/chip-tool/BUILD.gn so it has the following cflags: cflags = [ Build will fail due to type confusion with the same errors as above. Adding -Wformat-type-confusion to global settings would catch future errors. |
Filed #7935 on this; need to find the right place to add this. |
* Fix log formats for command and endpoint. Trying to log them as 16-bit integers fails on some compilers, since they are 8-bit. * Regenerated generated files
Problem
Compile error on some compiler; reported on Slack
Change overview
Use the right format.
Testing
Compiled locally, but the real test will be whether the bug reporter can compile...