error: expression .... ->CCM_Type::ROOT[0].CCM_Type::<unnamed struct>::TARGET_ROOT' has side-effects kCLOCK_RootM4_1 = (uint32_t)(&((CCM_Type*) ... ->ROOT[0].TARGET_ROOT),

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

error: expression .... ->CCM_Type::ROOT[0].CCM_Type::<unnamed struct>::TARGET_ROOT' has side-effects kCLOCK_RootM4_1 = (uint32_t)(&((CCM_Type*) ... ->ROOT[0].TARGET_ROOT),

985 Views
tom_orsi1
Contributor II

The solution to this problem is to use the offsetof, review this single line in the fsl_clock.h that needs propagated for both enums that use the CCM macro and all their entries. 

/*! @brief ccm root name used to get clock frequency. */
typedef enum _clock_root_control
{
kCLOCK_RootM4 = (uint32_t)CCM_BASE+offsetof(CCM_Type,ROOT[1].TARGET_ROOT), /*!< ARM Cortex-M4 Clock control name.*/

Labels (1)
Tags (2)
0 Kudos
Reply
3 Replies

913 Views
anton_glukhov
Contributor III

Hello Thomas,

Do you know if this suggestion will be incorporated into SDK? I also have the same problem while I'm compiling with c++ compiler.

I'm compiling with g++ version 8.3 and offsetof doesn't solve the issue. Does it work it for you?

Best regards,

Anton

0 Kudos
Reply

913 Views
tom_orsi
Contributor I

Can you paste the error messages into this thread? offsetof is definitely a solution and if its recognized by your compiler it should solve your problem. 

0 Kudos
Reply

913 Views
anton_glukhov
Contributor III

Hello Tom,

Sorry for the delay. Everything is fine, it was an error because of cmake cache. It works now. Thank you!

But it's interesting if there is a plan to include it into SDK.

Best regards,

Anton

0 Kudos
Reply