RAD Studio
ContentsIndex
PreviousUpNext
W8051: Non-volatile function 'function' called for volatile object

(Command-line option to suppress warning: -w-nvf) 

In C++, a class member function was called for a volatile object of the class type, but the function was not declared with volatile following the function header. Only a volatile member function can be called for a volatile object. 

For example, if you have

  class c
  {
  public:
    f() volatile;
    g();
  };
  volatile c vcvar;

it is legal to call vcvar.f(), but not to call vcvar.g().

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!