-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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(components): Compiler reports some warnings (IDFGH-14275) #15068
Conversation
esp-idf/components/driver/twai/twai.c warning: unused variable 'res' [-Wunused-variable] XXX | bool res = twai_hal_init(&p_twai_obj->hal, &hal_config); | ^~~ esp-idf/components/fatfs/diskio/diskio_rawflash.c warning: unused variable 'part' [-Wunused-variable] XX | const esp_partition_t* part = s_ff_raw_handles[pdrv]; | ^~~~ esp-idf/components/fatfs/vfs/vfs_fat_sdmmc.c warning: unused variable 'found' [-Wunused-variable] XXX | bool found = s_get_context_id_by_card(card, &id); | ^~~~~
👋 Hello safocl, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
@@ -547,8 +547,7 @@ esp_err_t twai_driver_install_v2(const twai_general_config_t *g_config, const tw | |||
.clock_source_hz = clock_source_hz, | |||
.controller_id = controller_id, | |||
}; | |||
bool res = twai_hal_init(&p_twai_obj->hal, &hal_config); | |||
assert(res); | |||
assert(twai_hal_init(&p_twai_obj->hal, &hal_config)); |
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.
If assert is disabled, the function called inside the assert
will not be invoked. (it is an expected behavior of assert).
Then the twai driver missed an important initialization.
Description
Some variables inserted to asserts, but it produce the warning reports with CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=n :
This PR fix it (remove temporary unused variables).
Checklist
Before submitting a Pull Request, please ensure the following: