cancel
Showing results for 
Search instead for 
Did you mean: 

Gfx 4.24.1, C++20, warning: compound assignment with 'volatile'-qualified left operand is deprecated [-Wvolatile]

ferro
Lead

Dear Gfx Team,

When building Gfx in CubeIDE 1.17, C++20 compiler,

in file framework\include\platform\core\MCUInstrumentation.hpp ,

statement 'cc_consumed += cc_temp' causes this warning

../Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp: In member function 'virtual void touchgfx::MCUInstrumentation::setMCUActive(bool)':
../Middlewares/ST/touchgfx/framework/include/platform/core/MCUInstrumentation.hpp:73:37: warning: compound assignment with 'volatile'-qualified left operand is deprecated [-Wvolatile]
   73 |                         cc_consumed += cc_temp;
      |                         ~~~~~~~~~~~~^~~~~~~~~~

If you could please change it to

cc_consumed = cc_consumed + cc_temp;

With this change the warning is no longer.

Thanks
Ferro

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks. We will change in a later release.

Remember you can also just change your copy. Either in the Middlewares folder or in your installation.

Pavel is also correct, but remember this code is C++98 :)

Thanks for comments.

 

 

View solution in original post

3 REPLIES 3
Pavel A.
Evangelist III

This looks like misuse of volatile instead of atomic ((

 

Thanks. We will change in a later release.

Remember you can also just change your copy. Either in the Middlewares folder or in your installation.

Pavel is also correct, but remember this code is C++98 :)

Thanks for comments.

 

 

"We will change in a later release."

Lovely. Thanks  @Flemming Gram CHRISTENSEN 

 

"you can also just change your copy"

I do. It is suboptimal.

 

"this code is C++98"

Old is gold. This is very interesting. It would be great to learn more about the TouchGfx/codebase history - why it still uses 'C++98, what aspects of the ecosystem hold Gfx back from adopting a newer standard, etc. Perhaps a 'Knowledge Base' article could cover this.