This chapter describes diagnostic messages generated by the SAS/C C++ Development System and SAS/C C++ Cross-Platform Development System. Translator diagnostics identify program errors such as missing or misplaced tokens, extraneous tokens, and type mismatches but cannot tell you whether your programming logic is correct.
Each diagnostic includes the message number and text, the error level (for example, ERROR or WARNING), an explanation of the message, and if possible, a solution.
C++ diagnostics have the form
LSCT[num] [severity]: [message text]If the translator generates one or more error messages, the source program is incorrect and translation is terminated without producing a compiled output file. Warning messages, on the other hand, indicate potential problems which may not affect how the program is compiled, linked, and executed.
You should fix the errors in the order they appear on your display or listing. Sometimes a single error in your program can result in multiple error messages. The translator attempts to pinpoint the line number in which the error occurred, but occasionally, the error may occur in a line before the line number given by the translator.
Note: Some messages refer you to additional information in the reference section of Bjarne Stroustrup's The C++ Programming Language, Second Edition (CPL2).
The C++ message prefix LSCT has been omitted from the descriptions
below.
LSCT Messages
101
ERROR: Illegal token.
Explanation
A symbol that is not recognized as a valid token has been detected in
the input. For example, you may have a symbol that you intended to be a
C++ identifier, but that contains a character not permitted in
identifiers. For instance, symbols cannot have a number as the first
character of the identifier.
102
ERROR: Can't find file: [filename].
Explanation
The file specified in a #include
directive cannot be found.
103
ERROR: Invalid filename.
Explanation
The filename in a #include
directive must be enclosed in double quotes
("") or angle
brackets (<>).
104
ERROR: End of file encountered in comment.
Explanation
The end of the source file has been detected while a comment was being processed (and
before the comment terminator was seen).
105
WARNING: Invalid escape sequence.
Explanation
An invalid escape sequence has been detected. An invalid escape sequence is a backslash
(\) followed by a character not valid in such a context. For example, \z is not a valid
escape sequence.
106
ERROR: Illegal preprocessor directive.
Explanation
A # character followed by a symbol not recognized as a valid preprocessor directive has
been detected. You may have misspelled the directive.
107
WARNING: Extra token(s) after preprocessor directive.
Explanation
A #if
, #else
, or #endif
directive has been followed by some text not within a
comment.
108
ERROR: Missing identifier in preprocessor context.
Explanation
An identifier is required in the given preprocessor context, but is not present. For example,
if a line at your program is #if defined
instead of #if defined myfunc
, this message
is issued.
109
ERROR/WARNING: Redefinition of preprocessor symbol: [symbol].
Explanation
A previously defined symbol has been redefined. If the definitions are not the same, this is
an error.
110
ERROR: Missing ')' in macro call.
Explanation
An occurrence of a left parenthesis in a macro call has not been
matched by a right parenthesis.
111
ERROR: Missing argument to preprocessor macro.
Explanation
A preprocessor macro has been called with fewer arguments than the macro requires.
Check the definition of the macro to determine which arguments are missing.
112
ERROR: Missing comma in preprocessor expression.
Explanation
A comma is required to separate the arguments in a definition or call of a function-like
preprocessor macro.
113
ERROR: Illegal operator in preprocessor context.
Explanation
The preprocessor has detected an operator that it cannot understand. Examples of
operators that are illegal in the preprocessor context are: ++,
--, . , and ->.
114
ERROR: Missing operand in preprocessor context.
Explanation
An operand was expected but not found.
115
ERROR: Illegal expression in preprocessor context.
Explanation
The preprocessor has encountered an expression it cannot understand. For example, an
operand may be expected but is not present, or the operand is of a non-integral type (for
example, a floating-point constant).
116
ERROR: Preprocessor number not a true number.
Explanation
A token beginning with a digit resembles an integer or floating-point constant, but is not
correct. For example, you may have mistyped a digit in a hexadecimal constant or
mistyped a floating-point exponent field.
117
ERROR: Integer required in preprocessor expression.
Explanation
A non-integer operand has been detected in a preprocessor expression. The logical
operators (!, ||, and &&) require integral operands.
118
ERROR: Extra #else or #elif.
Explanation
A #else
or #elif
directive has been found without a matching #if
directive.
119
ERROR: Extra #endif.
Explanation
A #endif directive has been found without a matching #if
directive.
121
ERROR: Invalid #line format.
Explanation
The preprocessor has encountered an invalid #line
directive. The form of the #line
directive is
#line number "string"where
number
must be an integer constant and "string"
must be enclosed in double quotes.
ERROR: Missing parenthesis in preprocessor expression.
ERROR: Illegal use of # operator.
ERROR: #error directive.
#error
directive. This message is issued whenever
a #error
directive is encountered.
ERROR: Illegal ## expression.
##
operator is missing. This may happen if the
##
expression begins or ends the line.
ERROR: Illegal operand of ## operator.
##
expression is not an identifier. You may have misspelled the
identifier.
ERROR/WARNING: Unterminated string or character constant.
ERROR: Character literals must contain at least one character.
ERROR: Unterminated preprocessor conditional.
#elif
directive) was pending. One or more #endif
directives are missing.
ERROR: Integer value out of range.
ERROR: Constant too large for [data-type].
ERROR/WARNING: Syntax error [more-explanation].
Because any #pragma
not recognized by an implementation must be ignored,
diagnostics pertaining to #pragma map
and #pragma linkage
are issued as
warnings rather than errors. However, you should treat them as errors because no action is
taken on a faulty #pragma
of this sort.
205
ERROR: Newline within string or character literal.
Explanation
The newline character (indicating an end of line) has been found within a string literal or
character literal. Usually this occurs when a terminating single quote or double quote has
been omitted from the literal.
206
ERROR: Bad character in input [hex-number].
Explanation
The specified character has been detected in the input and is not an
acceptable character for a token. Normally this condition occurs only if
your source file has had odd characters inserted in it, perhaps as a
result of uploading or downloading the file from one machine to another.
207
WARNING: Asterisk found as first character of C++ style comment.
Explanation
You may have made an error in starting the comment. Check that it
begins as a C style comment (/* */) instead of a C++ style
(//) comment.
208
WARNING: C style comment starting on line line-number never ends.
Explanation
There is no terminating */ sequence to the comment. Either you have forgotten the
comment terminator or you intended the comment to be a C++ style comment.
319
ERROR: '[identifier]' not declared.
Explanation
The specified identifier [identifier] is not declared. It may be misspelled.
320
ERROR: No such class: '[identifier]'.
Explanation
The specified identifier is not a class, but is used in a place where a class name is required,
such as before the ::
operator or in a base-specifier-list.
321
ERROR: 'struct' or 'class' used on 'enum [identifier]'.
Explanation
The specified identifier is an enum
tag, but the keyword struct
or class
was used
instead of enum
.
322
ERROR: 'enum' used on 'class [identifier]'.
Explanation
The specified identifier is a class tag, but the keyword enum
was used
instead of struct
or class
.
323
ERROR: '[identifier]' previously declared to be a [type-name].
Explanation
The specified identifier was previously declared to have some other type.
324
ERROR: '[identifier]' redefined.
Explanation
The specified identifier was previously defined in this scope.
325
ERROR: Scoped declaration in parameter list.
Explanation
The ::
operator cannot be used in parameter lists.
326
ERROR: Label '[label-name]' not defined.
Explanation
The specified label appeared as the target of at least one goto
statement in the previous
function, but the label was never defined in the function. Labels are defined in a function
using the label : statement
notation.
327
ERROR: Label '[label-name]' previously defined.
Explanation
The specified label was defined more than once in the same function.
328
ERROR: Repeated keyword or type name: '[keyword]'.
Explanation
A keyword or type name was used more than once within a single declaration.
329
ERROR: Conflicting keywords or type names: '[keyword-1]' and '[keyword-2]'.
Explanation
An illegal combination of keywords or type names was used in this declaration.
330
ERROR: Must be integral, pointer, or member pointer.
Explanation
An expression of a non-testable type was used where a testable value is
required. Testable types are all the integral, pointer and
member-pointer types. Testable values are required as the first
expression of a ?:
operator and as the test for the if, while, do while,
and for
statements.
331
ERROR: Must be integral.
Explanation
An expression of a non-integral type was used where an integral valued
expression is required. An integral value is required in a case
label
and in the test expression of a switch
statement.
332
ERROR: No such conversion.
Explanation
An illegal conversion was specified in a cast operator.
334
ERROR: Expression is not modifiable.
Explanation
You have tried to assign, increment, or decrement something that was not a modifiable
lvalue.
335
ERROR: Invalid use of '&' address-of operator. [object].
Explanation
The address-of operator (&) was applied to an object that was not
addressable. Examples of nonaddressable objects are bitfields and
register variables. Also, you cannot take the address of an overloaded
function except as an initializer.
336
ERROR: Cannot initialize [variable] with [initializer].
Explanation
The initializer is of a type that cannot be converted to the type of the
variable it is initializing.
337
ERROR: Preprocessor error.
Explanation
The preprocessor has encountered an error that is beyond its
capabilities to diagnose.
Action
Contact SAS/C Technical Support.
338
ERROR: Unexpected end of file.
Explanation
The parser reached the end of the input source before it expected to.
This may occur during error recovery from a previous syntax error in
the input source. Otherwise, it usually indicates that a closing brace
(}) or semicolon (;) has been omitted at the end of your source.
339
WARNING: A non-lvalue array was converted to a pointer.
Explanation
Only arrays that are lvalues can be converted to pointers. Because the
array is not converted to a pointer, operator []
should not be applied
to it because operator []
requires a pointer. Also the array should not
be assigned to a pointer variable. If you want only to access the array,
you may ignore this warning. However, if you want to alter the value of
an array element, you should treat this message as an error.
340
ERROR: The base name '[class-1]' is ambiguous in class '[class-2]'.
Explanation
The class [class-1] occurs more than once as a base of the second class, [class-2].
342
ERROR: Conversion from a virtual base class '[class-name]' to a derived class is not allowed.
Explanation
Virtual base classes cannot be converted, either explicitly or implicitly,
to derived classes.
343
ERROR: Ambiguous conversion to integral type from 'class [class-name]'.
Explanation
The class has defined multiple conversions to an integral type.
344
ERROR: Ambiguous conversion to pointer from 'class [class-name]'.
Explanation
The class has defined multiple conversions to pointer.
345
ERROR: Ambiguous conversion to testable from 'class [class-name]'.
Explanation
The class has defined multiple conversions to one or more of arithmetic, pointer, or
member-pointer types.
346
ERROR: Ambiguous conversion to derived member pointer.
Explanation
An ambiguous reference to the derived member-pointer has been found. Resolve the
ambiguity by qualifying the pointer name with its class name.
347
ERROR: Ambiguous conversion of overloaded function pointer.
Explanation
An ambiguous reference to the overloaded function pointer has been found. Resolve the
ambiguity by qualifying the function pointer name with its class name.
348
ERROR: Ambiguous conversion to class.
Explanation
Compiler found an ambiguous reference to the conversion to a class. For
example, you may have a file-scope function that has the same name as a
class (hence, the same name as the conversion function of that class).
349
ERROR: Ambiguous conversion.
Explanation
An ambiguous conversion has been specified. For example, a constructor and a function
cannot have the same name.
350
ERROR: Ambiguous function call.
Explanation
The function name used in the call is ambiguous. For example, two classes
using different functions with the same name may not have used
a class name to qualify the function name called.
351
ERROR: Overloaded functions '[function-1]' and '[function-2]' used ambiguously in conditional expression.
Explanation
Two overloaded functions were used as the second and third operands to a
conditional operator (?:
). These overloaded functions have more
than one function type in common. Cast one or both operands to the
desired function pointer or member function pointer type.
352
ERROR: Ambiguous common base class: [class-name].
Explanation
The reference to the base class is ambiguous. Resolve the ambiguity by
further qualifying each occurrence of this name.
353
ERROR: Ambiguous member name: [member-name].
Explanation
The expression used to refer to the member could refer to more than one
function, object, type, or enumerator. Resolve the ambiguity by
qualifying the member name with its class name.
354
ERROR: Non-static member '[member-name]' must be used with dot, arrow, or address-of operator.
Explanation
Non-static
members can be used only in the following contexts:
&class-name::member-name
)
sizeof
or offsetof
expression
-static
member function of a class that contains or inherits the member
(where the this->
operation is implied).
ERROR: Value of an undefined class cannot be used.
ERROR: An array may not be the target of an assignment.
ERROR: A function may not be the target of an assignment.
ERROR: Cannot [operation] a pointer to [type].
void
, a function
pointer, or a pointer to an undefined class. Nor can you use the
indirection operator (*) on a pointer to void
or a pointer to an
undefined class. The error message explains which of these mistakes you
have made.
ERROR: Typedef names cannot be declared in parameter lists.
typedef
name has been encountered in a parameter list. Move the definition of the
typedef
name outside the parameter list (that is, to file scope).
ERROR: Cannot take the address of a member of virtual base class.
ERROR: Invalid initializer.
ERROR: Invalid use of void.
void
.
ERROR: Cast to undefined class not allowed.
ERROR: Cannot find offset into non-class.
ERROR: Cannot find offset into undefined class.
ERROR: Invalid use of the scope operator.
::
can be used only in such expressions as
C3::mem
or
C1::C2::C3::mem
, where C1
is a class in which class C2
is declared, C3
is a class
declared in C2
, and mem
is a member of C3
.
ERROR: Cannot find the offset of 'object'.
char
, and its
number of bits may not comprise an integral number of chars
, a
bitfield in C++ has no size.
ERROR: Cannot find offset because class '[class-name]' has no member named '[member-name]'.
ERROR: Cannot take the size of an undefined class.
ERROR: Cannot dereference pointer to undefined class.
ERROR: No such constructor.
ERROR: '[identifier]' previously declared as [type-1]. Cannot be defined as [type-2].
union
specifier cannot be defined using
struct
or class
.
Similarly, a name declared as struct
or class
cannot be defined using union
.
ERROR: No such member '[member-name]'.
ERROR: Member '[member-name]' redeclared.
ERROR: '[identifier]' not a definable member.
ERROR: 'this' may occur only in a (non-static) member function.
this
keyword outside the context of a non-static
member
function.
ERROR: Cannot create a new value of a function.
new
operator cannot be applied to a function type. Functions cannot be allocated by
means of the new
operator.
ERROR: Cannot create a new value of a reference.
new
operator cannot be applied to a reference type. Because a reference type is not an
object, a pointer to it could not be returned by operator new
.
ERROR: Cannot create a new instance of an undefined class.
new
operator can be applied
to it to create a new
instance of the class.
ERROR: Missing array size in expression.
ERROR: Class '[class-name]' has no default constructor.
operator new
to allocate an array of class objects
if the class does not
have a default constructor.
ERROR: Cannot initialize new array.
new
operator cannot be initialized
by specifying a
brace-enclosed initializer list.
ERROR: Cannot delete an object of an undefined class.
delete
operator cannot be applied to an object whose class
has not been defined.
ERROR: Length expression of array must be integral.
ERROR: No match for call to function or overloaded operator.
ERROR: Missing constructor body.
ERROR: Non-virtual functions '[function-name]' cannot be declared pure.
ERROR: Uninitialized const identifier.
ERROR: Uninitialized const identifier or reference: [identifier].
extern
specifier has been used
ERROR: Const identifier or reference member '[member-name]' must be initialized.
const
identifier or reference must be initialized explicitly. This
message is caused by a constructor for a class with a const
or
reference member where the const
or reference member is not
initialized with a mem-initializer in the constructor.
ERROR: Member '[member-name]' must have initializer, class `[class-name]' has no default constructor.
For example, if the type of X::a
is a class with a constructor
(but no default constructor) you receive this message if you omit the
a(10)
in the following code:
X::X() : a(10), b(11) { . . . }
ERROR: Base '[class-name]' must have initializer, class '[class-name]' has no default constructor.
For example, if b
is a base class of X
and is a
class with a constructor (but no default
constructor), you receive this message if you omit the
b(11)
in the following code:
X::X() : a(10), b(11) { . . . }
ERROR: Virtual base class '[class-name]' must have initializer since class has no default constructor.
ERROR: '[identifier]' is not a base class or member of class '[class-name]'.
ERROR: Member access through protected base class not allowed for '[member-name]'.
ERROR: Member access through private base class not allowed for '[member-name]'.
ERROR: Base access through protected base class not allowed.
ERROR: Base access through private base class not allowed.
ERROR: Cannot access protected member '[member-name]'.
member-name
is not in a function or
initializer that has access to it. Because member-name
is protected,
only functions of the following
types have access to member-name
:
member-name
member-name
.
ERROR: Cannot access private member '[member-name]'.
member-name
is not in a
function or initializer that has access to it. Because member-name
is private,
only functions that are members or friends of the class that declared
member-name
have access to member-name
. Initializers for members of a class have the
same access privileges as functions of that class.
ERROR: Virtual function '[function-name]' declared in virtual base '[class-name]' must be overridden.
ERROR: Parameter of type 'void'.
void
.
ERROR: Default argument expression missing.
ERROR: Multiple declarations of function specifying default arguments.
ERROR: Arrays cannot contain elements of type 'void'.
void
.
ERROR: Arrays cannot contain bitfields.
ERROR: Arrays cannot contain functions.
ERROR: Functions cannot return functions.
ERROR: Functions cannot return arrays.
ERROR: Functions cannot return bitfields.
ERROR: Functions cannot return undefined classes.
ERROR: Pointers cannot point to references.
ERROR: Pointers cannot point to bitfields.
ERROR: References cannot refer to references.
ERROR: References cannot refer to bitfields.
ERROR: References cannot refer to objects of type 'void'.
void
objects, so there cannot be a reference to one.
ERROR: Member pointers cannot point to bitfields.
ERROR: Member pointers cannot point to references.
ERROR: Member pointers cannot point to objects of type 'void'.
void
objects, a pointer cannot point to one.
ERROR: Bitfields must be of integral type.
ERROR: Overloaded functions with indistinguishable arguments.
WARNING: K&R C style function definition.
suppress
translator option to
turn it off.
ERROR: K&R C style functions cannot return classes with constructors or destructors.
ERROR: Conversion function must be a member function.
ERROR: Destructor function must be a member function.
ERROR: Conversion function '[function-name]' not correctly declared.
ERROR: Destructor function '[destructor]' not correctly declared.
void
).
ERROR: Copy constructor for a class may not take an argument whose type is that class.
class ABC
by declaring a
copy constructor of the form ABC::ABC(const ABC&)
.
ERROR: Operator function '[function-name]' not correctly declared.
ERROR: Invalid linkage specifier.
extern
keyword must be followed by a string literal
containing either "C"
or "C++"
. This error may also be
caused by an extra or misspelled token after an extern keyword.
"C"
and "C++"
must be specified in uppercase.
ERROR: Linkage differs from prior declaration.
ERROR: Unknown linkage convention.
"C"
and "C++"
linkage
conventions. Linkage to other languages must be specified using the
SAS/C language keywords. For more information on using other languages
in combination with C, see the
SAS/C Compiler Interlanguage Communication Feature User's Guide.
ERROR: Missing class name.
ERROR: Repeated base class.
ERROR: Objects of abstract classes '[object-name]' cannot be declared.
ERROR: Object of type 'void'.
void
.
ERROR: Static members '[member-name]' of a local class may not be initialized.
static
data members of local classes
are automatically initialized to zero.
ERROR: Cannot use undefined enum '[identifier]'.
ERROR: Enum constants '[identifier]' must be initialized with integral values.
ERROR: A class cannot be a member of itself.
ERROR: Cannot declare members of an undefined class.
ERROR: Cannot declare arrays of an undefined class.
ERROR: Cannot declare variables of an undefined class.
ERROR: Cannot initialize data members in member declaration.
-static
data members must be initialized in the mem-initializer of each
constructor function. Static
data members must be initialized
outside the class.
ERROR: Member function of a local class must be defined within that class: [class-name].
ERROR: Member '[member-name]' declared 'void'.
void
.
ERROR: 'friend' used on non-function.
friend
keyword has meaning only in function declarations inside a class.
ERROR: 'friend' can only be used inside a class.
friend
keyword has meaning only in function declarations inside a class.
ERROR: Invalid syntax for access declaration.
friend
keyword
friend
keyword, remove the
type information, or remove the class name and scope operator, depending
upon which type of declaration you intended.
ERROR: Invalid access adjustment: '[member-name]'.
ERROR: Access cannot be changed, but only reinstated.
ERROR: Previously declared as a member in this class.
ERROR: '[class::member]' is not a member of a base class.
ERROR: Access declaration names class that is not a base of this class.
ERROR: Constructor function '[constructor]' not correctly declared.
void
), and the name of the constructor must be the same as the class
name.
ERROR: Destructor function '[destructor]' not correctly declared.
void
). The name of
the destructor must be a tilde (~) followed by the class name.
ERROR: Operator function '[function-name]' not correctly declared.
this
argument, which counts against
this limit. So, for example, a unary operator declared as a member
function has no explicit formal parameters.
ERROR: Static functions '[function-name]' cannot be virtual.
static
functions cannot be virtual. Remove the virtual
keyword from the
declaration of the static
function.
ERROR: Constructors '[constructor]' cannot be virtual.
ERROR: Static functions '[function-name]' cannot be used to override virtual functions.
static
member function was declared to have the same name and
argument types as a virtual function inherited from a base class. Use a
different name for the static
function.
ERROR: Linkage specification cannot be used in a member declaration '[member-name]'.
ERROR: Cannot define classes or enums in return types or parameter lists.
ERROR: Invalid parameter name '[parameter]'.
ERROR: Formal '[argument]' is not listed in function declaration.
ERROR: Initialized local extern '[variable]'.
ERROR: A type name [name] cannot be initialized.
typedef
names cannot contain initializers.
ERROR: Class with constructors must have an initializer.
ERROR: Cannot define classes or enums in type names.
new
operators, sizeof
expressions, or offsetof
expressions.
ERROR: Not a function.
ERROR: A mem-initializer may be used only within constructor functions.
ERROR: Base or member '[identifier]' re-initialized.
a(10)
part appears twice:
X::X() : a(10), a(10) { . . . }
ERROR: Old style base initializer cannot be used on class with no bases.
X
has no base classes, the following code tries to
initialize a non-existent base and generates this message:
X:: X() : (10) { . . . }To correct the error, delete the
(10)
part.
ERROR: Old style base initializer cannot be used on class with multiple base classes.
X
has more than one base, the
following code is ambiguous and generates this message:
X::X() : (10) { . . . }To correct the error, insert the name of a specific base class before the
(10)
.
WARNING: Statement is unreachable.
ERROR: 'case' label must be within a switch statement.
case
label is not allowed outside of a switch
statement.
ERROR: `default' label must be within a switch statement.
default
label is not allowed outside of a switch
statement.
ERROR: 'continue' must be within a loop ('do', 'for', or 'while') statement.
continue
statement is not allowed outside of a loop statement.
ERROR: 'break' must be within a switch or loop ('do', 'for', or 'while') statement.
break
statement is valid only within switch
or loop
statements.
ERROR: Missing return value.
ERROR: Return value given for constructor, destructor, or void function.
void
function.
ERROR: Missing function name in function declaration.
ERROR: Illegal formal declaration list in prototype function definition.
ERROR: Formal '[argument]' must be declared in function header identifier list.
ERROR: Expression in array declarator must be constant expressions.
ERROR: Expression in array declarator must be integral.
ERROR: Expression in array declarator must be positive.
ERROR: Map directive does not match prior directive.
ERROR: Invalid bitfield size.
ERROR: Cannot use undefined class '[class-name]' as base class.
ERROR: Missing declaration-specifier.
ERROR: Illegal use of '[item]' in local member function.
static
variables,
extern
variables and
functions, and enumeration constants only from the enclosing scope.
ERROR: A class cannot be derived from a union ['union-name'].
ERROR: A union ['union-name'] cannot be derived from another class.
ERROR: Constant expression contains a division by zero (0).
ERROR: Cannot take the size of a function.
ERROR: Cannot take the size of a bitfield.
ERROR: Cannot take the size of void.
void
objects, you cannot take the size of one.
ERROR: Cannot take the size of array with unspecified length.
WARNING: Cannot jump into a block to a label after a declaration having an initializer.
goto
statement to jump into a block if the
destination label occurs after a declaration has been initialized.
Should such a jump occur, the object in question would not be
initialized but could be referenced in subsequent code.
ERROR: Overloaded member functions '[function-name]' may not be both
static
and non-static. Explanation
All member functions of the same name must be either static
or non-static
.
512
ERROR: Function hides a virtual function from base class.
Explanation
Because the function hides a virtual function, the virtual function is not called.
513
ERROR: Overriding virtual function has different return type.
Explanation
An overriding virtual function cannot change the return type.
514
ERROR: Arrays cannot contain references.
Explanation
Arrays of references are not allowed.
515
ERROR: Previous declaration of function had different return type.
Explanation
An earlier declaration of the function specified a different return type.
516
ERROR: Cannot have two extern "C" functions with same name '[name]'.
Explanation
In a program, only one of a set of overloaded functions of a given name can be declared
extern "C"
.
517
ERROR: Previous declaration differed in the use of __builtin.
Explanation
All declarations of a function must be consistent in the use of the
__builtin
keyword.
All must have it, or none must have it.
518
ERROR: [object-type] '[expression]' cannot be used in default argument expressions.
Explanation
Non-static
members, formal parameters, and automatic variables
cannot be used in
default argument expressions.
521
ERROR: Ambiguous use of keyword.
Explanation
An ILC language keyword was used in a place where it could apply to two different
functions. Follow these rules when placing ILC language keywords:
ERROR: Keyword can only be used on functions.
virtual
and
inline
can
be used only in function declarations.
ERROR/WARNING: '[keyword]' cannot be applied to [object-type].
auto
to the definition of a class (although auto
can be applied
to the definition of an object whose type is that class). Depending
upon the combination of keywords in question, this may be treated as a
warning or an error.
ERROR: Previous declaration was not static.
-static
and later declared static
.
ERROR: Function declared 'inline' after first use.
ERROR: Prototypes can only be specified for C, C++, and __asm functions.
ERROR: Only C, C++, and __asm functions can be overloaded.
ERROR: Member functions must be C++ functions.
ERROR: Keyword can only be used on function pointers.
__local
and __remote
can be used only
on function pointers.
ERROR: Previous errors prevent continuation.
ERROR: A declaration must declare something.
ERROR: [function-name] cannot have '[storage-type]' storage class.
const
or volatile
cannot also be declared static
.
WARNING: Extra comma at end of enumeration list.
WARNING: Enum value: [value] is used for both '[enum-1]' and '[enum-2]'.
enum
constants in the same enumeration type have the same value. This
may be what you intended; the warning is given in case it is not
intended.
ERROR: Cannot overload 'main' or '_dynamn'.
main
nor _dynamn
can be overloaded.
ERROR: Cannot call or take the address of 'main'.
main
cannot be called, nor can its address be taken.
ERROR: 'main' cannot be 'storage-type'.
static
or inline
.
ERROR: Anonymous classes cannot have constructors or destructors.
ERROR: Destructor names '[destructor]' must be the same as their class names '[class]'.
ERROR: Expression in array declarator must not be negative.
ERROR: Cannot allocate array of class '[class-name]' with no default constructor.
new
operator, the class must have a default
constructor.
ERROR: Invalid constructor given for member '[member-name]'.
ERROR: '[operand-1]' and '[operand-2]' are not compatible types for
conditional operator.
ERROR: [type-1] [operator] [type-2]: Invalid type for binary operator.
ERROR: '[operand]' is of invalid type for postfix operator '[operator]'.
ERROR/WARNING: '[operator]' is invalid for operand type '[operand]'.
ERROR: '[object]' is of invalid type for call operator.
ERROR: Invalid pointer conversion from '[type-1]' to '[type-2'].
WARNING: Non-const and/or non-volatile member function called with const and/or volatile object.
-const
member function for a
const
object or a non-volatile
member function for a
-volatile
object, but because many other compilers fail to diagnose
this error, SAS/C C++ treats it as a warning. Ignoring this warning
allows non-const
functions to change data declared as
const
WARNING: Non-constant reference '[reference-object]' initialized with a non-lvalue.
-const
but has
been initialized with something that
is not an lvalue.
ERROR: Cannot take size of pointer to overloaded function '[function-name]'.
sizeof
cannot be applied to such a pointer.
ERROR: Error writing to output file: [filename].
stderr
may contain library messages with additional
information about the error.
ERROR: Inline member function does not end.
ERROR: Static function '[function-name]' was not defined.
static
but has not been defined in this source file.
ERROR: Global anonymous unions must be static.
static
.
ERROR: Anonymous unions may not have function members.
union
,
struct
, or class
.
ERROR: Anonymous unions may not have private or protected members.
union
, struct
, or class
.
ERROR: '[identifier]' redeclared in anonymous union.
ERROR: An anonymous union cannot be declared as a static member.
ERROR: Cannot load special character table '[table-name]'.
ERROR: Conflicting declaration of name '[identifier]' reserved for [purpose].
ERROR: Cannot initialize a function '[function-name]'.
ERROR: Static members [member-name] cannot be initialized by a mem-initializer.
Static
members should be initialized by the definition of the static
member outside the class. For example, this message is issued if you use
the following code and a is a static
member:
X::X() : a(10) { . . . }
ERROR: Enum constants [identifier] cannot be initialized by a mem-initializer.
Enum
constants should be initialized inside the enum
declaration, as they are in C. For
example, this message is issued if a
is an enumeration constant:
X::X() : a(10) { . . . }
ERROR: Types must match in a delete expression: [type-1->~type-2].
ERROR: Cannot create a new value of a void.
new
operator cannot be applied to void
. Because
void
is not an object type, a
pointer to it could not be returned by operator new
.
ERROR: Loop in -> operators.
ERROR: A linkage-specification may occur only in file scope.
ERROR: Cannot define a type in return or argument types.
struct
tag) cannot be defined in
an argument list or in the
specification of the return type.
ERROR: [object] may not have the same name as its class.
static
data member, enumeration, member of an anonymous union,
or a nested type cannot have the same name as its class.
ERROR: An overloaded operator cannot have default arguments.
int operator + (int=3,int=4)
is not a valid
declaration.
ERROR: Invalid use of abstract class: [class-name].
ERROR: An object of a class with an [object-type] may not be a member of a union.
union
. For more information,
refer to CPL2 r.9.5.
ERROR: Error declaring 'new': [reason].
operator new
must have a return type of void*
.
Its first argument is required and
must be of type size_t
. For more information, refer to CPL2 r.12.5.
ERROR: Error declaring 'delete': [reason].
delete
function must have return type void
.
Its first argument must be of type
void*
and if there is a second argument, it must be of type
size_t
arguments are permitted. For more information, refer to CPL2 r.12.5.
ERROR: Initializer-clause cannot be used for class having an [object-type].
={10,2,10.2}
). For more information, refer to CPL2 r.8.4.1.
ERROR: Conversion to a virtual base class '[class-name]' from a derived class is not allowed for member pointers.
ERROR: Cannot return [attempted-return-type] from function returning [declared-return-type].
ERROR: Function '[function-name]' has an initializer.
ERROR: Character array [array-name] too short for string of length [string-length].
ERROR: Too many initializers for [array-name]: found [num] initializers.
ERROR: Too many initializers for [class-name].
ERROR: Left operand of '[operator]' must be [type].
ERROR: Type '[type]' is invalid for the left operand of '[operator]'.
ERROR: Case label value must be a constant expression.
case
label.
ERROR: Duplicate case label value.
case
label occurs more than once within a switch
statement.
ERROR: More than one default.
default
label in a single switch
statement.
ERROR: [symbol-name] is not an enum.
enum
keyword,
but is not an enumeration.
ERROR: [symbol-name] is not a class, struct, or union.
class
, struct
,
or union
keyword, but is not a class
, struct
,
or union
.
WARNING: Wide and narrow character strings concatenated, using [width].
L"abc"
;
narrow characters strings are the usual
"abc"
. These two types of strings should not be
concatenated together. For example,
neither of the following statements are valid:
"abc" L"def" /* wrong */ L"abc" "def" /* wrong */If the first string in the concatenation is wide, the translator treats the result as a wide string. Similarly, if the first string is narrow, the translator treats the result as narrow.
WARNING: Missing return statement.
return
statement is missing at the end of
the outer block of a function and a return
value is required.
WARNING: Zero-length array used.
class
, struct
, and
union
) as an extension of standard C and C++. This message is only to
warn you about the use of this extension. If you do not want to see this
warning, use the suppress
translator option to turn it off.
ERROR: Floating point value out of range.
ERROR/WARNING: [data-type-1] initialized with [data-type-2].
int
has been used to initialize a char
. If the
initializer is a constant whose value is too large to be represented by
the shorter type, this is an error. If the initializer is a variable,
this is a warning. (If the value of a constant initialization can be
represented by the shorter type, neither a warning nor an error is
issued.)
ERROR/WARNING: [data-type-1] assigned to [data-type-2].
long
has been assigned to a short
. If the value assigned is a
constant which is too large to be represented by the shorter type, this
is an error. If the assigned type is a variable, this is a warning. (If
the value of an assigned constant can be represented by the shorter
type, neither a warning nor an error is issued.)
ERROR/WARNING: [sign-type-1 data-type-1] assigned to [sign-type-2 data-type-2].
long
has been assigned to an unsigned long
),
or conversely, an unsigned data type has been assigned to a signed data
type of the same size (for example, an unsigned int
has been assigned to
an int
). If the assigned value is a constant that cannot be represented
correctly by the type to which it is assigned, an error results.
Otherwise, the message is a warning.
ERROR: A function definition [name] requires an explicit parameter list.
typedef int F(int); F foo { return 10; }
WARNING: Implicit conversion of member function [name] to a member pointer.
WARNING: Symbol [name] was not used.
WARNING: Variable [name] used before being initialized.
ERROR: Return type of 'operator [new | delete]' cannot be changed after it has been used.
new
and
operator delete
functions. A program may declare its own versions
of these operator functions with differing return types from those
in the library, but this must be done before any use of these
operator functions.
new
and delete
before using their operators.
ERROR: [name] must be a function, not a [type].
ERROR: [data-type] may not use elipsis ('...').
new
.
ERROR: [name] must return a [type1] not a [type2].
ERROR:'operator new's first argument must be a 'size_t'.
new
must be a function returning a void pointer.
Its first argument must be a size_t
.
ERROR: 'operator delete's first and only argument must be a 'void *'.
delete
must be a function returning void. Its first and
only argument must be a void pointer.
ERROR: Previous declaration of [name] was [attribute1], this declaration is [attribute2].
Note:
For some attributes, C++ will apply a default if the attribute
is not explicitly specified in the declaration. A declaration with
a specific keyword may conflict with a previous declaration with no
keyword, depending on the current defaults. Which defaults are applied
by C++ depend upon the specific attribute and the user supplied options.
For example, if a previous declaration specified __rent
, the
current declaration for the same symbol cannot specify __norent
.
Declarations must be consistent.
611
ERROR: Previous declaration of [name] differed in the use of [attribute].
Explanation
An attribute of a symbol was declared differently in a previous
declaration. Either the previous declaration used a keyword
that is not present in this declaration, or did not use a keyword
that is present in this declaration.
Note that for some attributes, C++ will apply a default if the
attribute was not explicitly specified in the declaration. So
a declaration with a specific keyword may conflict with a
previous declaration with no keyword depending on the current
defaults. Which defaults are applied by C++ depend upon
the specific attribute and the user supplied options.
The declarations should be made consistant.
617
ERROR: Default argument(s) of function used before they are defined.
Explanation
The default arguments of one function cannot use the default
arguments of a function declared later in the class.
618
ERROR: Invalid use of K&R C style declaration for [name].
Explanation
Only global functions may use the K&R C style function syntax.
Member functions must use the C++ prototype syntax. This
error sometimes occurs because of a syntax error in the formal
argument list.
619
ERROR: Bitfields cannot be static members.
Explanation
Bitfields cannot be static members.
Action
Either make the bitfield non-static, change the
bitfields to an integral type, or nest the bitfield in another
struct
, and make the struct a static member.