HP-UX Cadvise Diagnostics Reference Guide (5900-1865, August 2012)

Table Of Contents
Example:
class A {
private:
int x;
} c;
c.x = 0;
Action:
Fix the access specifier of the member or the statement that is accessing the member.
Reference:
2267 old-style parameter list (anachronism)
Cause:
The given function is defined using the old style K&R syntax. The C standard has marked this syntax
as obsolescent, and it is not supported in C++. Consider using the standard C prototype syntax.
Example:
int foo(arg)
int arg;
{ return arg; }
Action:
Recode the function definition to use the recommended prototype-format definition.
Reference:
C99 6.9.1
2269 conversion to inaccessible base class %t is not allowed
Cause:
It is incorrect to assign a derived object to a protected or private base class pointer or reference
without an explicit cast. NOTE: If an explicit access specifier is missing while inheriting from a
base class then private inheritance is assumed. In case of inheriting from a struct public inheritance
is assumed.
Example:
class Base {};
class Derived: protected Base{};
Base *b = new Derived;
Action:
Check if you actually want to convert from the derived to base type. If yes, then provide an explicit
cast: Base *b = (Base*) new Derived;
Reference:
ANSI/ISO C++ 8.3.2 (4)
2276 name followed by :: must be a class or namespace name
Cause:
The qualifier type preceding :: is not declared or defined as a class or a namespace.
Example: T::type i;
Action:
Make sure that the declaration or definition of the class or the namespace is defined before it is
used. Check if the necessary header files containing the declaration/definition are included.
Reference:
38 Diagnostics Details