27-09-2024, 12:21 PM
While we agree that the mechanics of C++ require a member function to be
declared `volatile` in order for it to be called on a volatile object, MISRA's
intent is to make it clear that it is the member data that is volatile.
struct Data
{
int i;
int j;
};
struct UseData
{
int getData() const {
return m_data->i;
}
Data volatile * m_data;
};
declared `volatile` in order for it to be called on a volatile object, MISRA's
intent is to make it clear that it is the member data that is volatile.
struct Data
{
int i;
int j;
};
struct UseData
{
int getData() const {
return m_data->i;
}
Data volatile * m_data;
};
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group