Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

User16005
Level 1
Level 1
First question asked Welcome!

Hi,

 

using the XMC Library (newest version) with a compiler with -std=c++20 flag set results in many warnings like this: compound assignment with 'volatile'-qualified left operand is deprecated. And as there are many |= and &= in this low level code, this produces a huge amount of warnings.

As those expressions are not only in the source files but also in inline functions in the header files, building the XMC library as static library under C++17 is also not a solution to this problem.

As these compound operations with 'volatile'-qualified left operands will probably do not come back in future standards it would be great if you could come up with a solution to this.

A possibility would be this one. It produces the exact same assembly output if -O0 is not set.

What is your view on that?

 

Yours,

Elias

0 Likes
1 Solution
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Elias,

Thanks for reporting the issue. We have notified this issue to our software team to take care of this in future versions of XMC tool support. Meanwhile some suggestions for you to try out.

  1. Follow refactoring suggestions(as you have shared) in https://blog.feabhas.com/2021/05/modern-embedded-c-deprecation-of-volatile/ (this leads to a bit more verbose code). This involves modification of multiple XMCLib drivers. 

  2. You may also disable -Wvolatile checks by warning suppression:

                CXXFLAGS+=-Wno-volatile

 

Best Regards,
Vasanth

View solution in original post

0 Likes
1 Reply
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Elias,

Thanks for reporting the issue. We have notified this issue to our software team to take care of this in future versions of XMC tool support. Meanwhile some suggestions for you to try out.

  1. Follow refactoring suggestions(as you have shared) in https://blog.feabhas.com/2021/05/modern-embedded-c-deprecation-of-volatile/ (this leads to a bit more verbose code). This involves modification of multiple XMCLib drivers. 

  2. You may also disable -Wvolatile checks by warning suppression:

                CXXFLAGS+=-Wno-volatile

 

Best Regards,
Vasanth

0 Likes