Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 10.1.2: Justification for considering volatile member functions as inappropriate
#2
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;
   };
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: Rule 10.1.2: Justification for considering volatile member functions as inappropriate - by misra cpp - 27-09-2024, 12:21 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)