stm32f4xx_hal_driver
stm32f4xx_hal_driver copied to clipboard
(void)(tmpreg); is causing warnings
Not a bug, just annoying.
Please add it to your "nice to do on the next update" list.
This is a follow up to PR 1015.
The line (void)(tmpreg); causes the compiler to issue the following warning:
warning: conversion to void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}
This warning, along with a lot of supporting text, is repeated often enough that it is the majority of the compiler output That makes it hard to find the real issues.
I think you can get rid of tmpreg by doing the following:
REPLACE
tmpreg = READ_REG(TIMx->BDTR);
WITH
((uint32_t volatile)READ_REG(TIMx->BDTR)); // volatile guarantees this read is not optimized out
Hi @Bob-the-Kuhn,
Thank you for your contribution. The issue will be forwarded to our development teams. I will let you updated as soon as they provide me with their feedback. Thank you for your patience.
With regards,
ST Internal Reference: 112304
Hi @Bob-the-Kuhn,
Excuse this delayed answer. We have not been able to reproduce the compilation errors you have mentioned. So, would you please share the verbose compilation log and provide us with the flags you are building with.
With regards,
Hi @Bob-the-Kuhn,
Please allow me to close this thread as no activity. You may reopen it at anytime if you have any details to share with us in order to help you to solve the issue. Thank you for your comprehension.
With regards,