stm32f4xx_hal_driver icon indicating copy to clipboard operation
stm32f4xx_hal_driver copied to clipboard

(void)(tmpreg); is causing warnings

Open Bob-the-Kuhn opened this issue 5 years ago • 3 comments

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

Bob-the-Kuhn avatar Mar 27 '20 08:03 Bob-the-Kuhn

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,

ASELSTM avatar Apr 29 '20 12:04 ASELSTM

ST Internal Reference: 112304

ASELSTM avatar Aug 25 '21 09:08 ASELSTM

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,

ASELSTM avatar Jan 13 '22 15:01 ASELSTM

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,

ASELSTM avatar Apr 06 '23 14:04 ASELSTM