Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[openbsw-dev] Using C++20

Hi!

 

I’m considering C++20 for a project with OpenBSW.

 

When porting (compatibly) from C++14 to C++20, I found that most prominently many previously valid uses of the volatile keyword are deprecated by C++20.

 

E.g. enforcing explicit read-modify-write on volatile variables to reflect separate memory accesses, as in: A |= 3; which would end up in A = A | 3;

 

In other cases in OpenBSW, volatile could be removed as in function return types, e.g. platforms/s32k1xx/bsp/bspInterruptsImpl/include/interrupts/suspendResumeAllInterrupts.h, and in platforms/s32k1xx/bsp/bspAdc/include/adc/Adc.h:251, where optimization-prevention is already ensured by the access to the still volatile variable fADC.SC1

 

I can prepare a pull request, but first wanted to discuss if C++20 support would be welcome at this point.

 

Best regards,

 

Roland

 

 

--

BMW Group

Roland Reichwein

Software Architecture Central ECU

 

Festnetz:

+49-89-382-35297

 

Mobil:

+49-151-601-35297

 

Mail:

Roland.Reichwein@xxxxxx

 

Web:

https://www.bmwgroup.com/

 

 

logos

 

--------------------------------------------------------------

Bayerische Motoren Werke Aktiengesellschaft

Vorstand/Board of Management: Oliver Zipse (Vorsitzender/Chairman),

Ilka Horstmeier, Walter Mertl, Milan Nedeljković,

Jochen Goller, Joachim Post, Frank Weber.

Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Norbert Reithofer

Sitz und Registergericht/Domicile and Court of Registry: München HRB-42243

--------------------------------------------------------------

         

 


Back to the top