Appendix: C++ Diagnostic Messages

This appendix lists the warning and error messages produced by the Watcom C++ compilers. Diagnostic messages are issued during compilation and execution.

The messages listed in the following sections contain references to symbols that represent strings that are substituted by the Watcom C++ compilers to make the error message more exact:

%N
a string, usually a symbolic name that's not recognized as an identifier
%S
a string, usually an identifier or a member of a struct or union
%T
a string, usually the name of a type
%s
a string, usually a parsed token, label preprocessor symbol or command-line argument
%F
a filename
%L
a line number
%d
a string of digits
%u
a string of digits

The messages are ordered according to their numbers.

Use the following table to find a message quickly:
000-099 100-199 200-299 300-399 400-499 500-599 600-699 700-715
000 100 200 300 400 500 600 700
010 110 210 310 410 510 610 710
020 120 220 320 420 520 620
030 130 230 330 430 530 630
040 140 240 340 440 540 640
050 150 250 350 450 550 650
060 160 260 360 460 560 660
070 170 270 370 470 570 670
080 180 280 380 480 580 680
090 190 290 390 490 590 690

Consider the following program, named err.cpp, that contains errors:

#include <stdio.h>

void main()
  {
    int i;
    float i;

    i = 383;
    x = 13143.0;
    printf( "Integer value is %d\n", i );
    printf( "Floating-point value is %f\n", x );
  }

If we compile the above program, the following messages appear on the screen:

File: err.cpp
(6,12): Error! E042: symbol 'i' already defined
  'i' declared at: (5,9)
(9,5): Error! E029: symbol 'x' has not been 
  declared
err.cpp: 12 lines, included 174, no warnings, 
  2 errors

The diagnostic messages consist of the following information:

  1. the name of the file being compiled
  2. the line number and column of the line containing the error (in parentheses)
  3. a message number
  4. text explaining the nature of the error.

In the above example, the first error occurred on line 6 of the file err.cpp. Error number 042 (with the appropriate substitutions) was diagnosed. The second error occurred on line 9 of the file err.cpp. Error number 029 (with the appropriate substitutions) was diagnosed.

The following sections contain a complete list of the messages. Runtime messages (messages displayed during execution) don't have message numbers associated with them.

A number of messages contain a reference to the ARM. This is the Annotated C++ Reference Manual, written by Margaret A. Ellis and Bjarne Stroustrup, and published by Addison-Wesley (ISBN 0-201-51459-1).

Diagnostic messages 000-099

000 - internal compiler error
If this message appears, please report the problem directly to QNX Software Systems Limited.
001 - assignment of constant found in boolean expression
An assignment of a constant has been detected in a boolean expression. For example:
if( var = 0 )
      

You probably want to use ==, to test for equality.

002 - constant out of range; truncated
This message is issued if a constant can't be represented in 32 bits or if a constant is outside the range of valid values that can be assigned to a variable. For example:
int a = 12345678901234567890;
      
003 - missing return value
A function has been declared with a function return type, but no return statement was found in the function. Either add a return statement, or change the function return type to void. For example:
int foo( int a )
{
    int b = a + a;
}
      

The message is issued at the end of the function.

004 - base class '%T' does not have a virtual destructor
A virtual destructor has been declared in a class with base classes. The compiler has detected that a base class doesn't have a virtual destructor, so a delete of a pointer cast to the base class won't function properly in all circumstances. For example:
struct Base {
    ~Base();
};
struct Derived : Base {
    virtual ~Derived();
};
      

It's usually considered good programming practice to declare virtual destructors in all classes used as base classes of classes having virtual destructors.

005 - pointer or reference truncated
The expression contains a transfer of a pointer value to another pointer value of smaller size. This can be caused by __near or __far qualifiers (that is, assigning a far pointer to a near pointer). Function pointers can also have a different size than data pointers in certain memory models. This message indicates that some information is being lost, so check the code carefully.

For example:

extern int __far *foo();
int __far *p_far = foo();
int __near *p_near = p_far; // truncated
      
006 - syntax error; probable cause: missing ";"
The compiler has found a complete expression (or declaration) during parsing, but couldn't continue. The compiler has detected that it could have continued if a semicolon were present, so there may be a semicolon missing.
007 - "&array" may not produce intended result
The type of the expression &array is different from the type of the expression array.

Suppose we have the declaration char buffer[80]. Then the expression (&buffer + 3) is evaluated as (buffer + 3 * sizeof(buffer)), which is (buffer + 3 * 80), and not (buffer + 3 * 1), which is what most people expect to happen.

The ``address of'' operator (&) isn't required for getting the address of an array.

008 - returning address of function argument or of auto or register variable
This warning usually indicates a serious programming error. When a function exits, the storage allocated on the stack for auto variables is released. This storage will be overwritten by further function calls and/or hardware interrupt service routines. Therefore, the data pointed to by the return value may be destroyed before your program has a chance to reference it or make a copy of it.

For example:

int *foo()
{
  int k = 123;
  return &k;   // k is an automatic variable
}
    
009 - '##' tokens did not generate a single token (rest discarded)
When two tokens are pasted together using ##, they must form a string that can be parsed as a single token.
010 - asm directive ignored
The asm directive (for example, asm( "mov r0,1" ); ) is a non-portable construct. The Watcom C++ compiler treats all asm directives as comments.
011 - all members are private
This message warns you that there's no way to use the contents of the class because all attempts to access them will be flagged as erroneous (that is, accessing a private member).

For example:

class Private {
    int a;
    Private();
    ~Private();
    Private( const Private& );
};
    
012 - template argument cannot be type "%T"
A template argument can be either a generic type (for example, template < class T >), a pointer, or an integral type. These types are required for expressions that can be checked at compile time.
013 - unreachable code
The statement will never be executed, because there's no path through the program that causes control to reach it.

In the following example, the statement following the return statement can't be reached:

void foo( int *p )
{
    *p = 4;
    return;
    *p = 6;
}
      
014 - no reference to symbol '%S'
There are no references to the declared variable; its declaration can be deleted. If the variable is a parameter to a function, all calls to the function must also have the value for that parameter deleted.

In some cases, there may be a valid reason for retaining the variable. You can prevent the message from being issued through use of #pragma off(unreferenced), or adding a statement that assigns the variable to itself.

015 - nested comment found in comment started on line %u
While scanning a comment for its end, the compiler detected /* for the start of another comment. Nested comments aren't allowed in ANSI C. You may be missing the */ for the previous comment.
016 - template argument list cannot be empty
An empty template argument list would result in a template that could only define a single class or function.
017 - label '%s' has not been referenced by a goto
The indicated label hasn't been referenced and, as such, is useless. This warning can be safely ignored. For example:

int foo( int a, int b )
{
un_refed:
    return a + b;
}
      
018 - no reference to anonymous union member '%S'
The declaration for the anonymous member can be safely deleted without any effect.
019 - BREAK may only appear in a for, do, while, or switch statement
A break statement has been found in an illegal place in the program. You may be missing an opening brace ({) for a while, do, for or switch statement. For example:
int foo( int a, int b )
{
    break;    // illegal
    return a+b;
}
      
020 - CASE may only appear in a switch statement
A case label has been found that isn't inside a switch statement. For example:
int foo( int a, int b )
{
    case 4:    // illegal
    return a+b;
}
      
021 - CONTINUE may only appear in a for, do, or while statement
The continue statement must be inside a while, do or for statement. You may have too many closing braces (}) between the while, do or for statement and the continue statement. For example:
int foo( int a, int b )
{
    continue;    // illegal
    return a+b;
}
    
022 - DEFAULT may only appear in a switch statement
A default label has been found that isn't inside a switch statement. You may have too many closing braces (}) between the start of the switch and the default label. For example:
int foo( int a, int b )
{
    default: // illegal
    return a+b;
}
      
023 - misplaced "}" or missing earlier "{"
An extra closing brace (}) has been found that can't be matched up with an earlier opening brace ({).
024 - misplaced #elif directive
The #elif directive must be inside an #if preprocessing group, and before the #else directive, if present. For example:
int a;
#else
int c;
#elif IN_IF
int b;
#endif
      

The #else, #elif, and #endif statements above are all illegal because there's no #if that corresponds to them.

025 - misplaced #else directive
The #else directive must be inside an #if preprocessing group, and follow all #elif directives, if present. For example:
int a;
#else
int c;
#elif IN_IF
int b;
#endif
      

The #else, #elif, and #endif statements above are all illegal because there's no #if that corresponds to them.

026 - misplaced #endif directive
A #endif preprocessing directive has been found without a matching #if directive. You either have an extra #endif, or you are missing an #if directive earlier in the file. For example:
int a;
#else
int c;
#elif IN_IF
int b;
#endif
      

The #else, #elif, and #endif statements above are all illegal because there's no #if that corresponds to them.

027 - only one DEFAULT per switch statement is allowed
You can't have more than one default label in a switch statement. For example:
int translate( int a )
{
    switch( a ) {
      case 1:
        a = 8;
        break;
      default:
        a = 9;
        break;
      default: // illegal
        a = 10;
        break;
     }
     return a;
}
      
028 - expecting '%s' but found '%s'
A syntax error has been detected. The tokens displayed in the message should help you to determine the problem.
029 - symbol '%N' has not been declared
The compiler has found a symbol that hasn't been previously declared. The symbol may be spelled differently than the declaration, or you may need to #include a header file that contains the declaration. For example:
int a = b;  // b has not been declared
      
030 - left expression must be a function or a function pointer
The compiler has found an expression that looks like a function call, but it isn't defined as a function. For example:
int a;
int b = a( 12 );
      
031 - operand must be an 'lvalue'
The operand on the left side of an equals sign (=) must be a variable or memory location that can have a value assigned to it.

For example, both statements in the function below are invalid, since lvalues are expected where the additions are shown:

void foo( int a )
{
    ( a + 1 ) = 7;
    int b = ++ ( a + 6 );
}
      
032 - label '%s' already defined
All labels within a function must be unique. For example, the second label below is illegal:
void bar( int *p )
{
label:
    *p = 0;
label:
    return;
}
      
033 - label '%s' is not defined in function
A goto statement has referenced a label that isn't defined in the function. Add the necessary label, or check the spelling of the label(s) in the function. For example:
void bar( int *p )
{
    *p = 0;
    goto label;    // not defined
}
      

The label referenced in the goto isn't defined.

034 - dimension cannot be zero
The dimension of an array must be non-zero. For example:
int array[0];    // not allowed
      
035 - dimension can't be negative
The dimension of an array must be positive. For example:
int array[-1];    // not allowed
      
036 - dimensions of multi-dimension array must be specified
All dimensions of a multiple dimension array must be specified. The only exception is the first dimension, which can declared as [ ]. For example:
int array[ ][ ];    // not allowed
      
037 - invalid storage class for function
If a storage class is given for a function, it must be static or extern. For example:
auto void foo()    // invalid
{
}
      
038 - expression must be 'pointer to ...'
An attempt has been made to de-reference (*) a variable or expression that isn't declared to be a pointer. For example:

int a;
int b = *a;
      
039 - cannot take address of an rvalue
You can only take the address of a variable or memory location. For example:

char c;
char *p1 = & & c;   // not allowed
char *p2 = & (c+1);     // not allowed
      
040 - expression for '.' must be a class, struct or union
The compiler has encountered the pattern expression.field_name where the expression isn't a class, struct or union type. For example:
struct S
{
    int a;
};
int &fun();
int a = fun().a;
      
041 - expression for '->' must be pointer to class, struct or union
The compiler has encountered the pattern expression->field_name, where the expression isn't a pointer to class, struct or union type. For example:
struct S
{
    int a;
};
int *fun();
int a = fun()->a;
      
042 - symbol '%S' already defined
The specified symbol has already been defined. For example:

char a = 2;
char a = 2;    // not allowed
      
043 - static function '%S' has not been defined
A prototype has been found for a static function, but a definition for the static function hasn't been found in the file. For example:
static int fun( void );
int k = fun();
// fun not defined by end of program
      
044 - expecting label for goto statement
The goto statement requires the name of a label. For example:
int fun( void )
{
    goto;
}
      
045 - duplicate case value '%s' found
Every case value in a switch statement must be unique. For example:
int fun( int a )
{
    switch( a ) {
      case 1:
        return 7;
      case 2:
        return 9;
      case 1: // duplicate not allowed
        return 7;
    }
    return 79;
}
      
046 - bit-field width is too large
The maximum field width allowed is 16 bits in the 16-bit compiler, and 32 bits in the 32-bit compiler. For example:
struct S
{
    unsigned bitfield :48;  // too wide
};
      
047 - width of a named bit-field must not be zero
A bit field must be at least one bit in size. For example:

struct S {
    int bitfield :10;
    int :0;   // ok, aligns to int
    int h :0; // err, field is named
};
      
048 - bit-field width must be positive
You can't have a negative field width. For example:

struct S
{
  unsigned bitfield :-10; // can't be negative
};
      
049 - bit-field base type must be an integral type
The types allowed for bit fields are signed or unsigned varieties of char, short and int. For example:

struct S
{
  float bitfield : 10; // must be integral
};
      
050 - subscript on non-array
One of the operands of [ ] must be an array or a pointer. For example:

int array[10];
int i1 = array[0];  // ok
int i2 = 0[array];  // same as above
int i3 = 0[1];      // illegal
      
051 - incomplete comment
The compiler didn't find */ to mark the end of a comment.
052 - argument for # must be a macro parm
The argument for the preprocessor string-conversion operator (#) occurring in a macro definition must be a macro parameter.
053 - unknown preprocessing directive '#%s'
An unrecognized preprocessing directive has been encountered. Check the spelling. For example:

#i_goofed   // not valid
      
054 - invalid #include directive
A syntax error has been encountered in a #include directive. For example:

#include    // no header file
#include stdio.h
      

Both examples are illegal.

055 - not enough parameters given for macro '%s'
You haven't supplied enough parameters to the specified macro. For example:

#define mac(a,b) a+b
int i = mac(123);    // needs 2 parameters
      
056 - not expecting a return value
The specified function is declared as a void function. Delete the return statement, or change the type of the function. For example:

void fun()
{
  return 14;  //not expecting return value
}
      
057 - cannot take address of a bit-field
The smallest addressable unit is a byte. You can't take the address of a bit field. For example:

struct S
{   int bits :6;
    int bitfield :10;
};
S var;
void* p = &var.bitfield;    // illegal
      
058 - expression must be constant
The compiler expects a constant expression. This message usually occurs for declarators. It can also occur during static initialization if you're trying to initialize a non-pointer type with an address expression.
059 - unable to open '%s'
The file specified in an #include directive could not be located. Make sure that the file name is spelled correctly, or that the appropriate path for the file is included in the list of paths specified in the INCLUDE environment variable, or in the i option on the compiler command line (or in the I option for cc).
060 - too many parameters given for macro '%s'
You've supplied too many parameters for the specified macro. For example:

#define mac(a,b) a+b
int i = mac(1,2,3);    // needs 2 parameters
      
061 - cannot use __based or __far16 pointers in this context
The use of __based and __far16 pointers is prohibited in throw expressions and catch statements. For example:

extern int __based( __segname( "myseg" )) *pi;

void bad()
{
    try {
      throw pi;
    } catch( int __far16 *p16 ) {
      *p16 = 87;
    }
}
      

Both the throw expression and catch statements cause this error to be diagnosed.

062 - only one type is allowed in declaration specifiers
Only one type is allowed for the first part of a declaration. A common cause of this message is that there may be a missing semi-colon (;) after a class definition. For example:

class C
{
public:
    C();
}            // needs ";"

int foo() { return 7; }
      
063 - out of memory
The compiler has run out of memory to store information about the file being compiled. Try reducing the number of data declarations and or the size of the file being compiled. Don't #include header files that aren't required.
064 - invalid character constant
This message is issued for an improperly formed character constant. For example:

char c = '12345';
      
065 - taking address of variable with storage class 'register'
You can take the address of a register variable in C++ (but not in ANSI C). If there's a chance that the source will be compiled using a C compiler, change the storage class from register to auto. For example:

extern int foo( char* );
int bar()
{
    register char c = 'c';
    return foo( &c );
}
      
066 - 'delete' expression size is not allowed
The C++ language has evolved to the point where the delete expression size is no longer required for a correct deletion of an array.
067 - ending " missing for string literal
The compiler didn't find a second double quote to end the string literal. For example:

char *a = "no_ending_quote;
      
068 - invalid option '%s'
The specified option isn't recognized by the compiler.
069 - invalid optimization option '%s'
The specified option is an unrecognized optimization option.
070 - invalid memory model '%s'
The memory model option must be one of the following:
ms
Small memory model
mm
Medium memory model
mc
Compact memory model
ml
Large memory model
mh
Huge memory model
mf
Flat memory model
071 - expression must be integral
An integral expression is required. For example:

int foo( int a, float b, int *p )
{
    switch( a ) {
      case 1.3:     // must be integral
        return p[b];    // index not integer
      case 2:
        b <<= 2;    // can only shift integers
      default:
        return b;
    }
}
      
072 - expression must be arithmetic
Arithmetic operations, such as / and *, require arithmetic operands unless the operator has been overloaded, or unless the operands can be converted to arithmetic operands. For example:

class C
{
public:
    int c;
};
C cv;
int i = cv / 2;
      
073 - statement required after label
The C language definition requires a statement following a label. You can use a null statement that consists of just a semicolon (;). For example:

extern int bar( int );
void foo( int a )
{
    if( a ) goto ending;
    bar( a );
ending:
    // needs statement following
}
      
074 - statement required after 'do'
A statement is required between the do and while keywords.
075 - statement required after 'case'
The C language definition requires a statement following a case label. You can use a null statement that consists of just a semicolon (;). For example:

int foo( int a )
{
    switch( a ) {
      default:
        return 7;
      case 1: // needs statement following
    }
    return 18;
}
      
076 - statement required after 'default'
The C language definition requires a statement following a default label. You can use a null statement that consists of just a semicolon (;). For example:

int foo( int a )
{
    switch( a ) {
      case 7:
        return 7;
      default:
        // needs statement following
    }
    return 18;
}
      
077 - missing matching #endif directive
You're missing a #endif to terminate a #if, #ifdef or #ifndef preprocessing directive. For example:

#if 1
int a;
// needs #endif
      
078 - invalid macro definition, missing )
The right parenthesis ) is required for a function-like macro definition. For example:

#define bad_mac( a, b
      
079 - missing ) for expansion of '%s' macro
The compiler encountered end-of-file while collecting up the argument for a function-like macro. A right parenthesis ) is required to mark the end of the argument(s) for a function-like macro. For example:

#define mac( a, b) a+b
int d = mac( 1, 2
      
080 - %s
This is a user message generated with the #error preprocessing directive. For example:
#error my very own error message
      
081 - cannot define an array of functions
You can have an array of pointers to functions, but not an array of functions. For example:
typedef int TD(float);
TD array[12];
      
082 - function cannot return an array
A function can't return an array. You can return a pointer to an array. For example, the following is invalid:
typedef int ARR[10];
ARR fun( float );
      
083 - function cannot return a function
You can't return a function. You can return a pointer to a function. For example, the following is invalid:
typedef int TD();
TD fun( float );
      
084 - function templates can only have type arguments
A function template argument can only be a generic type (for example: template < class T >). This is a restriction in the C++ language that allows compilers to automatically instantiate functions purely from the argument types of calls.
085 - maximum class size has been exceeded
The 16-bit compiler limits the size of a struct or union to 64K so that the compiler can represent the offset of a member in a 16-bit register. This error also occurs if the size of a structure overflows the size of an unsigned integer. For example:

struct S
{
    char arr1[ 0xfffe ];
    char arr2[ 0xfffe ];
    char arr3[ 0xfffe ];
    char arr4[ 0xfffffffe ];
};
      
086 - definition of macro '%s' not identical to previous definition
If a macro is defined more than once, the definitions must be identical. If you want to redefine a macro to have a different definition, you must #undef it before you can define it with a new definition. For example:
#define CON 123
#define CON 124     // not same as previous
      
087 - initialization of '%S' must be in file scope
A file scope variable must be initialized in file scope. In the following example, the initializer for v must be outside the function definition:
void fn()
{
    extern int v = 1;
}
      
088 - default argument for '%S' declared outside of class definition
Problems can occur with member functions that don't declare all of their default arguments during the class definition. For instance, a copy constructor is declared if a class doesn't define a copy constructor. If a default argument is added later on to a constructor that makes it a copy constructor, an ambiguity results. For example:
struct S {
    S( S const &, int );
    // S( S const & ); <-- declared by 
    //                            compiler
};
// ambiguity with compiler-generated copy 
// constructor
// S( S const & );
S::S( S const &, int = 0 )
{
}
      
089 - ## must not be at start or end of replacement tokens
There must be a token on each side of the ## (token pasting) operator. For example:

#define badmac( a, b ) ## a ## b
      
090 - invalid floating-point constant
The exponent part of the floating-point constant isn't formed correctly. For example:

float f = 123.9E+Q;
      
091 - 'sizeof' is not allowed for a bit-field
The smallest object that you can ask for the size of is a char. For example:

struct S
{   int a;
    int b :10;
} v;
int k = sizeof( v.b );
      
092 - function '%S' has internal linkage because it is 'inline'
An inline function can't be declared as an extern function. This is due to the fact that there may be many invocations of the same function in different modules. The compiler can't guarantee that only one module will export an ``out of line'' version of the function. For example:

extern inline fun() { return 19; }
      
093 - must use 'va_start' macro inside function with variable arguments
The va_start() macro is used to set up access to the parameters in a function that takes a variable number of parameters. A function is defined with a variable number of parameters by declaring the last parameter in the function as ellipses (...). For example, the following function is incorrect, as it doesn't take a variable number of arguments, but still calls va_start():

#include <stdarg.h>
int foo( int a, int b )
{
    va_list args;
    va_start( args, a );
    va_end( args );
    return b;
}
      
094 - ***FATAL*** %s
A fatal error has been detected during code generation time. The type of error is displayed in the message.
095 - internal compiler error %d
A bug has been encountered in the compiler. Please report the specified internal compiler error number and any other helpful details about the program being compiled to QNX Software Systems Limited so that we can fix the problem.
096 - argument number %d - invalid register in #pragma
The designated registers can't hold the value for the parameter of the inline function defined by the pragma.
097 - procedure '%s' has invalid return register in #pragma
The size of the return register doesn't match the size of the result returned by the inline function defined by the pragma.
098 - illegal register modified by '%s' #pragma
This message applies to the modify directive in an inline function pragma.

For the 16-bit Watcom C/C++ compilers:

  • The BP, CS, DS, and SS registers can't be modified in small data models.
  • The BP, CS, and SS registers can't be modified in large data models.

For the 32-bit Watcom C/C++ compilers:

  • The EBP, CS, DS, ES, and SS registers can't be modified in flat memory models.
  • The EBP, CS, DS, and SS registers can't be modified in small data models.
  • The EBP, CS, and SS registers can't be modified in large data models.
099 - file must contain at least one external definition
Every file must contain at least one global object, (either a data variable or a function). This message is only issued in strict ANSI mode (za option).

Diagnostic messages 100-199

100 - out of macro space
The compiler ran out of memory for storing macro definitions.
101 - keyboard interrupt detected
The compile has been aborted with Ctrl-C or Ctrl-Break.
102 - duplicate macro parameter '%s'
The parameters specified in a macro definition must be unique. For example:

#define badmac( a, b, a ) a ## b
      
103 - unable to open work file: error code = %d
The compiler tries to open a new work file with the name __wrkN__.tmp, where N is a digit from 0 to 9. This message is issued if all these files already exist.
104 - write error on work file: error code = %d
An error was encountered trying to write information to the work file. The disk could be full.
105 - read error on work file: error code = %d
An error was encountered trying to read information from the work file.
106 - token too long; truncated
The token must be less than 510 bytes in length.
107 - filename required on command line
The name of a file to be compiled must be specified on the command line.
108 - command line contains more than one file to compile
You have more than one file name specified on the command line to be compiled. The compiler can only compile one file at a time. You can use the cc utility to compile multiple files with a single command.
109 - virtual member functions are not allowed in a union
A union can only be used to overlay the storage of data. The storage of virtual function information (in a safe manner) can't be done if storage is overlaid. For example:

struct S1{ int f( int ); };
struct S2{ int f( int ); };
union un { S1 s1;
           S2 s2;
           virtual int vf( int );
         };
      
110 - union cannot be used as a base class
This restriction prevents C++ programmers from viewing a union as an encapsulation unit. If it's necessary, you can encapsulate the union into a class and achieve the same effect. For example:

union U { int a; int b; };
class S : public U { int s; };
      
111 - union cannot have a base class
This restriction prevents C++ programmers from viewing a union as an encapsulation unit. If it's necessary, you can encapsulate the union into a class and inherit the base classes normally. For example:
class S { public: int s; };
union U : public S { int a; int b; };
      
112 - cannot inherit an undefined base class '%T'
The storage requirements for a class type must be known when inheritance is involved because the layout of the final class depends on knowing the complete contents of all base classes. For example:
class Undefined;
class C : public Undefined {
    int c;
};
      

In this example, Undefined only has a partial type, and therefore can't be used to determine storage layout.

113 - a repeated direct base class will cause ambiguities
Almost all accesses will be ambiguous. This restriction is useful in catching programming errors. The repeated base class can be encapsulated in another class if the repetition is required. For example:

class Dup
{
    int d;
};
class C : public Dup, public Dup
{
    int c;
};
      
114 - templates may only be declared in file scope
Currently, templates can only be declared at file scope. This simple restriction was chosen in favour of more freedom with possibly subtle restrictions.
115 - linkages may only be declared in file scope
A common source of errors in C and C++ is the use of prototypes inside of functions. This restriction attempts to prevent such errors.
116 - unknown linkage '%s'
Only the linkages C and C++ are supported by Watcom C++. For example:

extern "APL" void AplFunc( int* );
      
117 - too many storage class specifiers
This message is a result of duplicating a previous storage class or having a different storage class. You can only have one of the following storage classes:
  • extern
  • static
  • auto
  • register
  • typedef

For example:

extern typedef int (*fn)( void );
      
118 - a nameless declaration is not allowed
A type was used in a declaration but no name was given. For example:

static int;
      
119 - illegal combination of type specifiers
An incorrect scalar type was found. Either a scalar keyword was repeated, or the combination is illegal, as in the following examples:

short short x;
short long y;
      
120 - illegal combination of type qualifiers
A repetition of a type qualifier has been detected. Some compilers may ignore repetitions, but strictly speaking it's incorrect code. For example:

const const x;
struct S {
    int virtual virtual fn();
};
      
121 - syntax error
The C++ compiler was unable to interpret the text starting at the location of the message. The C++ language is sufficiently complicated that it's difficult for a compiler to correct the error itself.
122 - parser stack corrupted
The C++ parser has detected an internal problem that usually indicates a compiler problem. Please report this directly to QNX Software Systems Limited.
123 - template declarations cannot be nested within each other
Currently, templates can only be declared at file scope. Furthermore, a template declaration must be finished before another template can be declared.
124 - expression is too complicated
The expression contains too many levels of nested parentheses. Divide the expression up into two or more sub-expressions.
125 - invalid redefinition of the typedef name '%S'
Redefinition of typedef names is only allowed if you are redefining a typedef name to itself. Any other redefinition is illegal. You should delete the duplicate typedef definition. For example:
typedef int TD;
typedef float TD;   // illegal
      
126 - class '%T' has already been defined
This message usually results from the definition of two classes in the same scope. This is illegal, even if the class definitions are identical. For example:
class C {
};
class C {
};
      
127 - 'sizeof' is not allowed for an undefined type
If a type hasn't been defined, the compiler can't know how large it is. For example:
class C;
int x = sizeof( C );
      
128 - initializer for variable '%S' may not execute
The variable might not be initialized when code is executing at the position indicated in the message. The C++ language places these restrictions to prevent the use of uninitialized variables. For example:
int foo( int a )
{
    switch( a ) {
      case 1:
        int b = 2;
        return b;
      default: // b bypassed
        return b + 5;
    }
}
      
129 - division by zero in a constant expression
Division by zero isn't allowed in a constant expression. The value of the expression can't be used with this error. For example:
int foo( int a )
{
    switch( a ) {
      case 4 / 0:  // illegal
        return a;
    }
    return a + 2;
}
      
130 - arithmetic overflow in a constant expression
The multiplication of two integral values can't be represented. The value of the expression can't be used with this error. For example:
int foo( int a )
{
    switch( a ) {
      case 0x7FFF * 0x7FFF * 0x7FFF:  // overflow
        return a;
    }
    return a + 2;
}
      
131 - not enough memory to fully optimize procedure '%s'
The indicated procedure can't be fully optimized with the amount of memory available. The code generated will still be correct and execute properly. This message is purely informational (that is, buy more memory).
132 - not enough memory to maintain full peephole
Certain optimizations benefit from being able to store the entire module in memory during optimization. All functions will be individually optimized, but the optimizer won't be able to share code between functions if this message appears. The code generated will still be correct and execute properly. This message is purely informational (that is, buy more memory).
133 - too many errors: compilation aborted
The Watcom C++ compiler sets a limit to the number of error messages it will issue. Once the number of messages reaches the limit the above message is issued. This limit can be changed via the e command-line option.
134 - too many parm sets
An extra parameter-passing description has been found in the aux pragma text. Only one parameter-passing description is allowed.
135 - 'friend', 'virtual' or 'inline' modifiers may only be used on functions
This message indicates that you are trying to declare a strange entity like an inline variable. These qualifiers can only be used on function declarations and definitions.
136 - more than one calling convention has been specified
A function can't have more than one #pragma modifier applied to it. Combine the pragmas into one, and apply it once.
137 - pure member function constant must be '0'
The constant must be changed to 0 in order for the Watcom C++ compiler to accept the pure virtual member function declaration. For example:

struct S {
   virtual int wrong( void ) = 91;
};
      
138 - a 'based' modifier has been repeated
A repeated based modifier has been detected. There are no semantics for combining base modifiers, so this isn't allowed. For example:

char *ptr;
char __based( void ) __based( ptr ) *a;
      
139 - enumeration variable is not assigned a constant from its enumeration
In C++ (as opposed to C), enums represent values of distinct types. Thus, the compiler won't automatically convert an integer value to an enum type if you're compiling your source in strict ISO/ANSI C++ mode. If you have extensions enabled, this message is treated as a warning. For example:

enum Days { sun, mod, tues, wed, thur, fri, sat };
enum Days day = 2;
      
140 - bit-field declaration cannot have a storage class specifier
Bit-fields (along with most members) can't have storage class specifiers in their declaration. Remove the storage class specifier to correct the code. For example:
class C
{
public:
    extern unsigned bitf :10;
};
      
141 - bit-field declaration must have a base type specified
A bit-field can't make use of a default integer type. Specify the type int to correct the code. For example:
class C
{
public:
    bitf :10;
};
      
142 - illegal qualification of a bit-field declaration
A bit-field can only be declared const or volatile. Qualifications like friend aren't allowed. For example:

struct S {
    friend int bit1 :10;
    inline int bit2 :10;
    virtual int bit3 :10;
};
      

All three declarations of bit-fields are illegal.

143 - duplicate base qualifier
The compiler has found a repetition of base qualifiers like protected or virtual. For example:

struct Base { int b; };
struct Derived : public public Base { int d; };
      
144 - only one access specifier is allowed
The compiler has found more than one access specifier for a base class. Since the compiler can't choose one over the other, remove the unwanted access specifier to correct the code. For example:

struct Base { int b; };
struct Derived : public protected Base { int d; };
      
145 - unexpected type qualifier found
Type specifiers can't have const or volatile qualifiers. This shows up in new expressions because you can't allocate a const object.
146 - unexpected storage class specifier found
Type specifiers can't have auto or static storage class specifiers. This shows up in new expressions because you can't allocate a static object.
147 - access to '%S' is not allowed because it is ambiguous
There are two ways that this error can show up in C++ code:
  • The first way a member can be ambiguous is that the same name can be used in two different classes. If these classes are combined with multiple inheritance, accesses of the name are ambiguous. For example:

    struct S1 { int s; };
    struct S2 { int s; };
    struct Der : public S1, public S2
    {
        void foo() { s = 2; };  // s is ambiguous
    };
              
    
  • The second way a member can be ambiguous is when a nonvirtual base class is inherited more than once by a derived class. If a class is inherited non-virtually by two different classes that then get combined with multiple inheritance, an access of the member is faced with deciding which copy of the member is intended. Use the :: operator to clarify which member is being accessed, or access the member with a different class pointer or reference. For example:

    struct Top { int t; };
    struct Mid : public Top { int m; };
    struct Bot : public Top, public Mid
    {
        void foo() { t = 2; };  // t is ambiguous
    };
              
    
148 - access to private member '%S' is not allowed
The indicated member is being accessed by an expression that doesn't have permission to access private members of the class. For example:

struct Top { int t; };
class Bot : private Top
{
    int foo() { return t; };  // t is private
};
Bot b;
int k = b.foo();    // foo is private
      
149 - access to protected member '%S' is not allowed
The indicated member is being accessed by an expression that doesn't have permission to access protected members of the class. The compiler also requires that protected members be accessed through a derived class to ensure that an unrelated base class can't be quietly modified. This is a fairly recent change to the C++ language that may cause Watcom C++ to not accept older C++ code. See Section 11.5 in the Annotated C++ Reference Manual for a discussion of protected access.

For example:

struct Top { int t; };
struct Mid : public Top { int m; };
class Bot : protected Mid
{
protected:
    // t can't be accessed
    int foo() { return t; };
};
Bot b;
int k = b.foo(); // foo is protected
      
150 - operation does not allow both operands to be pointers
There may be a missing indirection in the code exhibiting this error. An example of this error is adding two pointers:

void fn()
{
   char *p, *q;
   p += q;
}
      
151 - operand is neither a pointer nor an arithmetic type
An example of this error is incrementing a class that doesn't have any overloaded operators. For example:

struct S { } x;
void fn()
{
   ++x;
}
      
152 - left operand is neither a pointer nor an arithmetic type
An example of this error is trying to add 1 to a class that doesn't have any overloaded operators. For example:

 
struct S { } x;
void fn()
{
    x = x + 1;
}
      
153 - right operand is neither a pointer nor an arithmetic type
An example of this error is trying to add 1 to a class that doesn't have any overloaded operators. For example:

struct S { } x;
void fn()
{
    x = 1 + x;
}
      
154 - cannot subtract a pointer from an arithmetic operand
The subtraction operands are probably in the wrong order. For example:

int fn( char *p )
{
    return( 10 - p );
}
      
155 - left expression must be arithmetic
Certain operations, such as multiplication, require both operands to be of arithmetic types. For example:

struct S { } x;
void fn()
{
    x = x * 1;
}
      
156 - right expression must be arithmetic
Certain operations, such as multiplication, require both operands to be of arithmetic types. For example:

struct S { } x;
void fn()
{
   x = 1 * x;
}
      
157 - left expression must be integral
Certain operators, like the bit manipulation operators, require both operands to be of integral types. For example:

struct S { } x;
void fn()
{
    x = x ^ 1;
}
      
158 - right expression must be integral
Certain operators, like the bit manipulation operators, require both operands to be of integral types. For example:

struct S { } x;
void fn()
{
    x = 1 ^ x;
}
      
159 - cannot assign a pointer value to an arithmetic item
The pointer value must be cast to the desired type before the assignment takes place. For example:

void fn( char *p )
{
    int a;

    a = p;
}
      
160 - attempt to destruct a far object when data model is near
Destructors can't be applied to objects that are stored in far memory when the default memory model for data is near. For example:

struct Obj
{   char *p;
    ~Obj();
};

Obj far obj;
      

The last line causes this error to be displayed when the memory model is small (option ms), since the memory model for data is near.

161 - attempt to call member function for far object when the data model is near
Member functions can't be called for objects that are stored in far memory when the default memory model for data is near. For example:

struct Obj
{   char *p;
    int foo();
};

Obj far obj;
int integer = obj.foo();
      

The last line causes this error to be displayed when the memory model is small (option ms), since the memory model for data is near.

162 - template type argument cannot have a default argument
Currently, the C++ language doesn't allow template type arguments to have a default type. There's neither syntax to express the notion nor semantics defined for its meaning.
163 - attempt to 'delete' a far object when the data model is near
delete can't be used to deallocate objects that are stored in far memory when the default memory model for data is near. For example:

struct Obj
{   char *p;
};

void foo( Obj far *p )
{
    delete p;
}
      

The second last line causes this error to be displayed when the memory model is small (option ms), since the memory model for data is near.

164 - first operand is not a class, struct or union
The offsetof operation can only be performed on a type that can have members. It's meaningless for any other type. For example:

#include <stddef.h>

int fn( void )
{
    return offsetof( double, sign );
}
      
165 - syntax error; class template cannot be processed
The class template contains unbalanced braces. The class definition can't be processed in this form.
166 - cannot convert right pointer to type of left operand
The C++ language won't allow the implicit conversion of unrelated class pointers. An explicit cast is required. For example:

class C1;
class C2;

void fun( C1* pc1, C2* pc2 )
{
  pc2 = pc1;
}
      
167 - left operand must be an 'lvalue'
The left operand must be an expression that is valid on the left side of an assignment. Examples of incorrect lvalues include constants and the results of most operators. For example:

int i, j;
void fn()
{
    ( i - 1 ) = j;
    1 = j;
}
      
168 - static data members are not allowed in a union
A union should only be used to organize memory in C++. Enclose the union in a class if you need a static data member associated with the union. For example:

union U
{
    static int a;
    int b;
    int c;
};
      
169 - invalid storage class for a member
A class member can't be declared with auto, register, or extern storage class. For example:

class C
{
    auto int a;     // can't specify auto
};
      
170 - declaration is too complicated
The declaration contains too many declarators (that is, pointer, array, and function types). Break up the declaration into a series of typedefs ending in a final declaration. For example:

int ************p;

// transform this to ...
typedef int ****PD1;
typedef PD1 ****PD2;
PD2 ****p;
      
171 - exception declaration is too complicated
The exception declaration contains too many declarators (that is, pointer, array, and function types). Break up the declaration into a series of typedefs ending in a final declaration.
172 - floating-point constant too large to represent
The Watcom C++ compiler can't represent the floating-point constant because the magnitude of the positive exponent is too large. For example:

float f = 1.2e78965;
      
173 - floating-point constant too small to represent
The Watcom C++ compiler can't represent the floating-point constant because the magnitude of the negative exponent is too large. For example:

float f = 1.2e-78965;
      
174 - class template '%S' cannot be overloaded
A class template name must be unique across the entire C++ program. Furthermore, a class template can't coexist with another class template of the same name.
175 - range of enum constants cannot be represented
If one integral type can't be chosen to represent all values of an enumeration, the values can't be used reliably in the generated code. Shrink the range of enumerator values used in the enum declaration. For example:

enum E
{   e1 = 0xFFFFFFFF,
    e2 = -1
};
      
176 - '%S' cannot be in the same scope as a class template
A class template name must be unique across the entire C++ program. Any other use of a name can't be in the same scope as the class template.
177 - invalid storage class in file scope
A declaration in file scope can't have a storage class of auto or register. For example:

auto int a;
      
178 - const object must be initialized
Constant objects can't be modified, so they must be initialized before use. For example:

const int a;
      
179 - declaration cannot be in the same scope as class template '%S'
A class template name must be unique across the entire C++ program. Any other use of a name can't be in the same scope as the class template.
180 - template arguments must be named
A member function of a template class can't be defined outside the class declaration unless all template arguments have been named.
181 - class template '%S' is already defined
A class template can't have its definition repeated even if it's identical to the previous definition.
182 - invalid storage class for an argument
An argument declaration can't have a storage class of extern, static, or typedef. For example:

int foo( extern int a )
{
    return a;
}
      
183 - unions cannot have members with constructors
A union should only be used to organize memory in C++. Allowing union members to have constructors would mean that the same piece of memory could be constructed twice. For example:

class C
{ C();
};
union U
{
    int a;
    C c;    // has constructor
};
      
184 - statement is too complicated
The statement contains too many nested constructs. Break up the statement into multiple statements.
185 - '%s' is not the name of a class
The right hand operand of a :: operator turned out not to reference a class type. Because the name is followed by another ::, it must name a nested class.
186 - attempt to modify a constant value
Modification of a constant value isn't allowed. If you must force this to work, take the address and cast away the constant nature of the type. For example:

static int const con = 12;
void foo()
{
    con = 13;        // error
    *(int*)&con = 13;    // ok
}
      
187 - 'offsetof' is not allowed for a bit-field
A bit-field can't have a simple offset, so it can't be referenced in an offsetof expression. For example:

#include <stddef.h>
struct S
{
    unsigned b1 :10;
    unsigned b2 :15;
    unsigned b3 :11;
};
int k = offsetof( S, b2 );
      
188 - base class is inherited with private access
This warning indicates that the base class was originally declared as a class, as opposed to a struct. Furthermore, no access was specified, so the base class defaults to private inheritance. Add the private or public access specifier to prevent this message, depending on the intended access.
189 - overloaded function cannot be selected for arguments used in call
Either conversions weren't possible for an argument to the function, or a function with the right number of arguments wasn't available. For example:

class C1;
class C2;
int foo( C1* );
int foo( C2* );
int k = foo( 5 );
      
190 - base operator operands must be " __segment :> pointer"
The base operator (:>) requires the left operand to be of type __segment, and the right operand to be a pointer. For example:

char _based( void ) *pcb;
char __far *pcf = pcb;    // needs :> operator
      

Examples of typical uses are as follows:

  • const __segment mySegAbs = 0x4000;
  • char __based( void ) *c_bv = 24;
  • char __far *c_fp_1 = mySegAbs :> c_bv;
  • char __far *c_fp_2 = __segname( "_DATA" ) :> c_bv;
191 - expression must be a pointer or a zero constant
In a conditional expression, if one side of the : is a pointer then the other side must also be a pointer or a zero constant. For example:

extern int a;
int *p = ( a > 7 ) ? &a : 12;
      
192 - left expression cannot be a pointer to 'void' or to a function
The expression requires that the scaling size of the pointer be known. Pointers to void or functions can't be incremented because there's no size defined for void or functions. For example:

void *p;
void *q = p + 2;
      
193 - right expression cannot be a pointer to 'void' or to a function
The expression requires that the scaling size of the pointer be known. Pointers to void or functions can't be incremented because there's no size defined for void or functions. For example:

void *p;
void *q = 2 + p;
      
194 - expression cannot be a pointer to 'void' or to a function
The expression requires that the scaling size of the pointer be known. Pointers to void or functions can't be incremented because there's no size defined for void or functions. For example:

void *p;
void *q = ++p;
      
195 - 'sizeof' is not allowed for a function
A function has no size defined for it by the C++ language specification. For example:

typedef int FT( int );

unsigned y = sizeof( FT );
      
196 - 'sizeof' is not allowed for a type 'void'
The type void has no size defined for it by the C++ language specification. For example:

void *p;
unsigned size = sizeof( *p );
      
197 - type cannot be defined in this context
A type can't be defined in certain contexts. For example: a new type can't be defined in an argument list, a new expression, a conversion function identifier, or a catch handler. For example:

extern int goop();
int foo()
{
    try {
        return goop();
    } catch( struct S { int s; } ) {
        return 2;
    }
}
      
198 - expression cannot be used as a class template parameter
The compiler has to be able to compare expressions during compilation, so this limits the complexity of expressions that can be used for template parameters. The only types of expressions that can be used for template parameters are constant integral expressions and addresses. Any symbols must have external linkage or must be static class members.
199 - premature end-of-file encountered during compilation
The compiler expects more source code at this point. This can be due to missing parentheses ()) or missing closing braces (}).

Diagnostic messages 200-299

200 - duplicate case value '%s' after conversion to type of switch expression
A duplicate case value has been found. Keep in mind that all case values must be converted to the type of the switch expression. Constants that may be different initially may convert to the same value. For example:

enum E { e1, e2 };
void foo( short a )
{
    switch( a ) {
      case 1:
      case 0x10001:    // converts to 1 as short
        break;
    }
}
      
201 - declaration statement follows an if statement

There are implicit scopes created for most control structures. Because of this, no code can access any of the names declared in the declaration. Although the code is legal, it might not be what you intended. For example:

void foo( int a )
{
    if( a )
      int b = 14;
}
      
202 - declaration statement follows an else statement

There are implicit scopes created for most control structures. Because of this, no code can access any of the names declared in the declaration. Although the code is legal, it might not be what you intended. For example:

void foo( int a )
{
  if( a )
    int c = 15;
  else
    int b = 14;
}
      
203 - declaration statement follows a switch statement
There are implicit scopes created for most control structures. Because of this, no code can access any of the names declared in the declaration. Although the code is legal, it might not be what you intended. For example:

void foo( int a )
{
    switch( a )
    int b = 14;
}
      
204 - 'this' pointer is not defined
The this value can only be used from within non-static member functions. For example:

void *fn()
{
    return this;
}
      
205 - declaration statement cannot follow a while statement
There are implicit scopes created for most control structures. Because of this, no code can access any of the names declared in the declaration. Although the code is legal, it might not be what you intended. For example:

void foo( int a )
{
  while( a )
    int b = 14;
}
      
206 - declaration statement cannot follow a do statement
There are implicit scopes created for most control structures. Because of this, no code can access any of the names declared in the declaration. Although the code is legal, it might not be what you intended. For example:

void foo( int a )
{
    do
      int b = 14;
    while( a );
}
      
207 - declaration statement cannot follow a for statement
There are implicit scopes created for most control structures. Because of this, no code can access any of the names declared in the declaration. Although the code is legal, it might not be what you intended. A for loop with an initial declaration is allowed to be used within another for loop, so this code is legal C++:

void fn( int **a )
{
    for( int i = 0; i < 10; ++i )
    for( int j = 0; j < 10; ++j )
        a[i][j] = i + j;
}
      

The following example, however, illustrates a potentially erroneous situation:

void foo( int a )
{
    for( ; a<10; )
    int b = 14;
}
      
208 - pointer to virtual base class converted to pointer to derived class
Since the relative position of a virtual base can change through repeated derivations, this conversion is very dangerous. All C++ translators must report an error for this type of conversion. For example:

struct VBase { int v; };
struct Der : virtual public VBase { int   d; };
extern VBase *pv;
Der *pd = (Der *)pv;
      
209 - cannot use far pointer in this context
Only near pointers can be thrown when the data memory model is near. For example:

extern int __far *p;
void foo()
{
    throw p;
}
      

When the small memory model (ms option) is selected, the throw expression is diagnosed as erroneous. Similarly, only near pointers can be specified in catch statements when the data memory model is near.

210 - returning reference to function argument or to auto or register variable
The storage for the automatic variable is destroyed immediately upon function return. Returning a reference effectively allows the caller to modify storage that doesn't exist. For example:

class C
{
    char *p;
public:
    C();
    ~C();
};

C& foo()
{
    C auto_var;
    return auto_var;    // not allowed
}
      
211 - #pragma attributes for '%S' may be inconsistent
A pragma attribute was changed to a value that matches neither the current default nor the previous value for that attribute. A warning is issued since this usually indicates an attribute is being set twice (or more) in an inconsistent way. The warning can also occur when the default attribute is changed between two pragmas for the same object.
212 - function arguments cannot be of type 'void'
Having more than one void argument isn't allowed. The special case of one void argument indicates that the function accepts no parameters. For example:

void fn1( void )    // OK
{
}
void fn2( void, void, void )    // Error!
{
}
      
213 - class template requires more parameters for instantiation
The class template instantiation has too few parameters supplied, so the class can't be instantiated properly.
214 - class template requires less parameters for instantiation
The class template instantiation has too many parameters supplied, so the class can't be instantiated properly.
215 - no declared 'operator new' has arguments that match
An operator new couldn't be found to match the new expression. Supply the correct arguments for special operator new functions that are defined with the placement syntax. For example:

#include <stddef.h>

struct S {
    void *operator new( size_t, char );
};

void fn()
{
    S *p = new ('a') S;
}
      
216 - wide character string concatenated with a simple character string
There are no semantics defined for combining a wide character string with a simple character string. To correct the problem, make the simple character string a wide character string by prefixing it with an L. For example:

char *p = "1234" L"5678";
      
217 - 'offsetof' is not allowed for a static member
A static member doesn't have an offset like simple data members. If this is required, use the address of the static member. For example:

#include <stddef.h>
class C
{
public:
    static int stat;
    int memb;
};

int size_1 = offsetof( C, stat );   // not allowed
int size_2 = offsetof( C, memb );   // ok
      
218 - cannot define an array of 'void'
Since the void type has no size, and there are no values of void type, you can't declare an array of void. For example:

void array[24];
      
219 - cannot define an array of references
References aren't objects, they are simply a way of creating an efficient alias to another name. Creating an array of references is currently not allowed in the C++ language. For example:

int& array[24];
      
220 - cannot define a reference to 'void'
You can't create a reference to a void, because there can be no void variables to supply for initializing the reference. For example:

void& ref;
      
221 - cannot define a reference to another reference
References aren't objects, they are simply a way of creating an efficient alias to another name. Creating a reference to another reference is currently not allowed in the C++ language. For example:

int & & ref;
      
222 - cannot define a pointer to a reference
References aren't objects, they are simply a way of creating an efficient alias to another name. Creating a pointer to a reference is currently not allowed in the C++ language. For example:

char& *ptr;
      
223 - cannot initialize array with 'operator new'
The initialization of arrays created with operator new can only be done with default constructors. The capability of using another constructor with arguments is currently not allowed in the C++ language. For example:

struct S
{
    S( int );
};
S *p = new S[10] ( 12 );
      
224 - '%N' is a variable of type 'void'
A variable can't be of type void. The void type can only be used in restricted circumstances because it has no size. For instance, a function returning void means that it doesn't return any value. A pointer to void is used as a generic pointer, but it can't be dereferenced.
225 - cannot define a member pointer to a reference
References aren't objects, they are simply a way of creating an efficient alias to another name. Creating a member pointer to a reference is currently not allowed in the C++ language. For example:

struct S
{
    S();
    int &ref;
};

int& S::* p;
      
226 - function '%S' is not distinct
The function being declared isn't distinct enough from the other functions of the same name. This means that all function overloads involving the function's argument types will be ambiguous. For example:

struct S {
    int s;
};
extern int foo( S* );
extern int foo( S* const ); // not distinct enough
      
227 - overloaded function is ambiguous for arguments used in call
The compiler couldn't find an unambiguous choice for the function being called. For example:

 
extern int foo( char );
extern int foo( short );
int k = foo( 4 );
      
228 - declared 'operator new' is ambiguous for arguments used
The compiler couldn't find an unambiguous choice for operator new. For example:

#include <stdlib.h>
struct Der
{
    int s[2];
    void* operator new( size_t, char );
    void* operator new( size_t, short );
};
Der *p = new(10) Der;
      
229 - function '%S' has already been defined
The function being defined has already been defined elsewhere. Even if the two function bodies are identical, there must be only one definition for a particular function. For example:

int foo( int s ) { return s; }
int foo( int s ) { return s; }    // illegal
      
230 - expression on left is an array
The array expression is being used in a context where only pointers are allowed. For example:

void fn( void *p )
{
    int a[10];

    a = 0;
    a = p;
    a++;
}
      
231 - user-defined conversion has a return type
A user-defined conversion can't be declared with a return type. The ``return type'' of the user-defined conversion is implicit in the name of the user-defined conversion. For example:

struct S {
    int operator int(); // can't have return type
};
      
232 - user-defined conversion must be a function
The operator name describing a user-defined conversion can only be used to designate functions. For example:

// operator char can only be a function
int operator char = 9;
      
233 - user-defined conversion has an argument list
A user-defined conversion can't have an argument list. Since user-defined conversions can only be non-static member functions, they have an implicit this argument. For example:

struct S {
    operator int( S& ); // can't have arguments
};
      
234 - destructor has a return type
A destructor can't have a return type (even void). The destructor is a special member function that isn't required to be identical in form to all other member functions. This allows different implementations to have different uses for any return values. For example:

struct S {
    void* ~S();
};
      
235 - destructor must be a function
The tilde (~) style of name is reserved for declaring destructor functions. Variable names can't make use of the destructor style of names. For example:

struct S {
    int ~S; // illegal
};
      
236 - destructor has an argument list
A destructor can't have an argument list. Since destructors can only be non-static member functions, they have an implicit this argument. For example:

struct S {
    ~S( S& );
};
      
237 - '%N' must be a function
The operator style of name is reserved for declaring operator functions. Variable names can't make use of the operator style of names. For example:

struct S {
    int operator+;  // illegal
};
      
238 - '%N' is not a function
The compiler has detected what looks like a function body. The message is a result of not finding a function being declared. This can happen in many ways, such as dropping the ':' before defining base classes, or dropping the '=' before initializing a structure via a braced initializer. For example:

struct D B { int i; };
      
239 - nested type 'class %s' has not been declared
A nested class hasn't been found but is required by the use of repeated :: operators. The construct A::B::C requires that A be a class type, and B be a nested class within the scope of A. For example:

struct B {
    static int b;
};
struct A : public B {
};
int A::B::b = 2;    // B not nested in A
      

The preceding example is illegal; the following is legal:

struct A {
    struct B {
    static int b;
    };
};
int A::B::b = 2;    // B nested in A
  
240 - 'enum %s' has not been declared
An elaborated reference to an enum couldn't be satisfied. All enclosing scopes have been searched for an enum name. Visible variable declarations don't affect the search. For example:

struct D {
    int i;
    enum E { e1, e2, e3 };
};
enum E enum_var;    // E not visible
      
241 - 'class %s' has not been declared
The construct A::B::C requires that A be a class type, and B be a nested class within the scope of A. The reference to A couldn't be satisfied. All enclosing scopes have been searched for a class name. Visible variable declarations don't affect the search. For example:

struct A{ int a; };

int b;
int c = B::A::b;
      
242 - only one initializer argument allowed for a scalar type
The comma (,) in a function-like cast is treated like an argument list comma (,). If a comma expression is desired, use parentheses to enclose it. For example:

void fn()
{
    int a;

    a = int( 1, 2 );        // Error!
    a = int( ( 1, 2 ) );    // OK
}
      
243 - default arguments are not part of a function's type
This message indicates that a declaration has been found that requires default arguments to be part of a function's type. The following are examples of incorrect declarations:
  • declaring a function typedef
  • declaring a pointer to a function with default arguments

For example:

typedef int TD( int, int a = 14 );
int (*p)( int, int a = 14 ) = 0;
      
244 - missing default arguments
Gaps in a succession of default arguments aren't allowed in the C++ language. For example:

void fn( int = 1, int, int = 3 );
      
245 - overloaded operator cannot have default arguments

Preventing overloaded operators from having default arguments enforces the property that binary operators will only be called from a use of a binary operator. Allowing default arguments would allow a binary operator + to function as a unary operator +. For example:

class C
{
public:
    C operator +( int a = 10 );
};
      
246 - left expression is not a pointer to a constant object
You can't assign a pointer to a constant type to a pointer to a non-constant type. This would allow a constant object to be modified via the non-constant pointer. Use a cast if this is absolutely necessary. For example:

char* fun( const char* p )
{
    char* q;
    q = p;
    return q;
}
      
247 - cannot redefine default argument for '%S'
Default arguments can only be defined once in a program, even if the value of the default argument is identical. For example:

static int foo( int a = 10 );
static int foo( int a = 10 )
{
    return a+a;
}
      
248 - using default arguments would be overload ambiguous with '%S'
The declaration declares enough default arguments that the function is indistinguishable from another function of the same name. For example:

void fn( int );
void fn( int, int = 1 );
      

Calling the function fn() with one argument is ambiguous, because it could match either the first fn() without any default arguments, or the second fn() with a default argument applied.

249 - using default arguments would be overload ambiguous with '%S' using default arguments
The declaration declares enough default arguments that the function is indistinguishable from another function of the same name with default arguments. For example:

void fn( int, int = 1 );
void fn( int, char = 'a' );
      

Calling the function fn() with one argument is ambiguous, because it could match either the first fn() with a default argument, or the second fn() with a default argument applied.

250 - missing default argument for '%S'
In C++, you're allowed to add default arguments to the right hand arguments of a function declaration in successive declarations. The message indicates that the declaration is only valid if there was a default argument previously declared for the next argument. For example:

void fn1( int     , int       );
void fn1( int     , int = 3 );
void fn1( int = 2, int       );    // OK

void fn2( int     , int       );
void fn2( int = 2, int       );    // Error!
      
251 - enum references must have an identifier
there's no way to reference an anonymous enum. If all enums are named, the cause of this message is most likely a missing identifier. For example:

enum   { X, Y, Z };    // anonymous enum
void fn()
{
    enum *p;
}
      
252 - class declaration has not been seen for '~%s'
A destructor has been used in a context where its class isn't visible. For example:

class C;

void fun( C* p )
{
    p->~S();
}
      
253 - a '::' qualifier cannot be used in this context
Qualified identifiers in a class context are allowed for declaring friend member functions. The Watcom C++ compiler also allows code that is qualified with its own class so that declarations can be moved in and out of class definitions easily. For example:

struct S {
    void S::foo( void )
    {
    }
};
      
254 - '%S' has not been declared as a member
In a definition of a class member, the indicated declaration must already have been declared when the class was defined. For example:

class C
{
public:
    int c;
    int goop();
};
int C::x = 1;
C::not_decled() { }
      
255 - default argument expression cannot use function argument '%S'
Default arguments must be evaluated at each call. Since the order of evaluation for arguments is undefined, a compiler must diagnose all default arguments that depend on other arguments. For example:

 
void goop( int d )
{
    struct S {
    // can't access "d"
    int foo( int c, int b = d )
        {
          return b + c;
        };
    };
}
      
256 - default argument expression cannot use local variable '%S'
Default arguments must be evaluated at each call. Since a local variable isn't always available in all contexts (for example, file scope initializers), a compiler must diagnose all default arguments that depend on local variables. For example:

void goop( void )
{
    int a;
    struct S {
    // can't access "a"
    int foo( int c, int b = a )
        {
        return b + c;
        };
    };
}
      
257 - access declarations may only be 'public' or 'protected'

Access declarations are used to increase access. A private access declaration is useless because there's no access level for which private is an increase in access. For example:

class Base
{
    int pri;
protected:
    int pro;
public:
    int pub;
};
class Derived : public Base
{
    private: Base::pri;
};
      
258 - cannot declare both a function and variable of the same name ('%N')
Functions can be overloaded in C++, but they can't be overloaded in the presence of a variable of the same name. Likewise, you can't declare a variable in the same scope as a set of overloaded functions of the same name. For example:

int foo();
int foo;
struct S {
    int bad();
    int bad;
};
      
259 - class in access declaration ('%T') must be a direct base class
Access declarations can only be applied to direct (immediate) base classes. For example:

struct B {
    int f;
};
struct C : B {
    int g;
};
struct D : private C {
    protected: B::f;    // adjust access
};
      

In the above example, C is a direct base class of D, and B is a direct base class of C, but B isn't a direct base class of D.

260 - overloaded functions ('%N') do not have the same access
If an access declaration is referencing a set of overloaded functions, then they all must have the same access. This is due to the lack of a type in an access declaration (that is, access declarations use the name only). For example:

class C
{
    static int foo( int );     // private
public:
    static int foo( float );   // public
};

class B : private C
{
public: C::foo;
};
      
261 - cannot grant access to '%N'
A derived class can't change the access of a base class member with an access declaration. The access declaration can only be used to restore access changed by inheritance. For example:

class Base
{
public:
    int pub;
protected:
    int pro;
};
class Der : private Base
{
    public: Base::pub;         // ok
    public: Base::pro;         // changes access
};
      
262 - cannot reduce access to '%N'
A derived class can't change the access of a base class member with an access declaration. The access declaration can only be used to restore access changed by inheritance. For example:

class Base
{
public:
    int pub;
protected:
    int pro;
};
class Der : public Base
{
    protected: Base::pub;    // changes access
    protected: Base::pro;    // ok
};
      
263 - nested class '%N' has not been defined
The current state of the C++ language supports nested types. Unfortunately, this means that some working C code won't work unchanged. For example:

struct S {
    struct T *link;
};
      

In the above example, the class T is reported as not defined by the end of the class declaration. The code can be corrected in the following manner:

struct T;    // declare T
struct S {
    struct T *link;
};
      
264 - user-defined conversion must be a non-static member function
A user-defined conversion is a special member function that allows the class to be converted implicitly (or explicitly) to an arbitrary type. In order to do this, it must have access to an instance of the class so it's restricted to being a non-static member function. For example:

struct S
{
    static operator int();
};
      
265 - destructor must be a non-static member function
A destructor is a special member function that performs cleanup on a class before the storage for the class is released. In order to do this, it must have access to an instance of the class, so it's restricted to being a non-static member function. For example:

struct S
{
    static ~S();
};
      
266 - '%N' must be a non-static member function
The operator function in the message is restricted to being a non-static member function. This usually means that the operator function is treated in a special manner by the compiler. For example:

class C
{
public:
    static operator =( C&, int );
};
      
267 - '%N' must have one argument
The operator function in the message is only allowed to have one argument. An operator like operator ~ is one such example because it represents a unary operator. For example:

class C
{
public: int c;
};
C& operator~( const C&, int );
      
268 - '%N' must have two arguments
The operator function in the message must have two arguments. An operator like operator += is one such example because it represents a binary operator. For example:

class C
{
public: int c;
};
C& operator += ( const C& );
      
269 - '%N' must have either one argument or two arguments
The operator function in the message must have either one argument or two arguments. An operator like operator + is one such example because it represents either a unary or a binary operator. For example:

class C
{
public: int c;
};
C& operator+( const C&, int, float );
      
270 - '%N' must have at least one argument
The operator new and operator new [ ] member functions must have at least one argument for the size of the allocation. After that, any arguments are up to the programmer. The extra arguments can be supplied in a new expression, via the placement syntax. For example:

#include <stddef.h>

struct S {
    void * operator new( size_t, char );
};

void fn()
{
    S *p = new ('a') S;
}
      
271 - '%N' must have a return type of 'void'
The C++ language requires that operator delete and operator delete [ ] have a return type of void. For example:

class C
{
public:
    int c;
    C* operator delete( void* );
    C* operator delete [ ]( void* );
};
      
272 - '%N' must have a return type of 'void *'
The C++ language requires that both operator new and operator new [ ] have a return type of void *. For example:

#include <stddef.h>
class C
{
public:
    int c;
    C* operator new( size_t size );
    C* operator new [ ]( size_t size );
};
      
273 - the first argument of '%N' must be of type 'size_t'
The C++ language requires that the first argument for operator new and operator new [ ] be of the type size_t. The definition for size_t can be included by using the standard header file <stddef.h>. For example:

void *operator new( int size );
void *operator new( double size, char c );
void *operator new [ ]( int size );
void *operator new [ ]( double size, char c );
      
274 - the first argument of '%N' must be 'void *'
The C++ language requires that the first argument for operator delete and operator delete [ ] be a void *. For example:

class C;
void operator delete( C* );
void operator delete [ ]( C* );
      
275 - the second argument of '%N' must be of type 'size_t'
The C++ language requires that the second argument for operator delete and operator delete [ ] be of type size_t. The two-argument forms of operator delete and operator delete [ ] are optional and can only be present inside of a class declaration. The definition for size_t can be included by using the standard header file <stddef.h>. For example:

struct S {
    void operator delete( void *, char );
    void operator delete [ ]( void *, char );
};
      
276 - the second argument of 'operator ++' or 'operator --' must be 'int'
The C++ language requires that the second argument for operator ++ be int. The two-argument form of operator ++ is used to overload the postfix operator ++. The postfix operator -- can be overloaded similarly. For example:

class C {
public:
    long cv;
};
C& operator ++( C&, unsigned );
      
277 - return type of '%S' must allow the '->' operator tobe applied
This restriction is a result of the transformation that the compiler performs when the operator -> is overloaded. The transformation involves transforming the expression to invoke the operator with "->" applied to the result of operator ->. For example:

struct S {
    int a;
    S *operator ->();
};

void fn( S &q )
{
    q->a = 1; // becomes (q.operator ->())->a = 1;
}
      
278 - '%N' must take at least one argument of a class/enum or a reference to a class/enum
Overloaded operators can only be defined for classes and enumerations. At least one argument must be a class or an enum type, in order for the C++ compiler to distinguish the operator from the built-in operators. For example:

class C {
public:
    long cv;
};
C& operator ++( unsigned, int );
      
279 - too many initializers
The compiler has detected extra initializers. For example:

int a[3] = { 1, 2, 3, 4 };
      
280 - too many initializers for character string
A string literal used in an initialization of a character array is viewed as providing the terminating null character. If the number of array elements isn't enough to accept the terminating character, this message is displayed. For example:

char ac[3] = "abc";
      
281 - expecting '%s' but found expression
This message is displayed when some bracing or punctuation is expected but an expression was encountered. For example:

int b[3] = 3;
      
282 - anonymous struct/union member '%N' cannot be declared in this class
An anonymous member can't be declared with the same name as its containing class. For example:

struct S {
    union {
    int S;    // Error!
    char b;
    };
};
      
283 - unexpected '%s' during initialization
This message is output when some unexpected bracing or punctuation is encountered during initialization. For example:

int e = { { 1 };
      
284 - nested type '%N' cannot be declared in this class
A nested type can't be declared with the same name as its containing class. For example:

struct S {
    typedef int S;    // Error!
};
      
285 - enumerator '%N' cannot be declared in this class
An enumerator can't be declared with the same name as its containing class. For example:

struct S {
    enum E {
      S,    // Error!
      T
    };
};
      
286 - static member '%N' cannot be declared in this class

A static member can't be declared with the same name as its containing class. For example:

struct S {
    static int S;    // Error!
};
      
287 - a constructor cannot have a return type
A constructor can't have a return type (even void). The constructor is a special member function that isn't required to be identical in form to all other member functions. This allows different implementations to have different uses for any return values. For example:

class C {
public:
    C& C( int );
};
      
288 - a constructor cannot be a static member
A constructor is a special member function that takes raw storage and changes it into an instance of a class. In order to do this, it must have access to storage for the instance of the class, so it's restricted to being a non-static member function. For example:

class C {
public:
    static C( int );
};
      
289 - invalid copy constructor argument list (causes infinite recursion)
A copy constructor's first argument must be a reference argument. Furthermore, any default arguments must also be reference arguments. Without the reference, a copy constructor would require a copy constructor to execute in order to prepare its arguments. Unfortunately, this would be calling itself since it's the copy constructor. For example:

struct S {
    S( S const & );   // copy constructor
};
      
290 - a constructor cannot be declared 'const' or 'volatile'
A constructor must be able to operate on all instances of classes regardless of whether they are const or volatile. For example:

class C {
public:
    C( int ) const;
    C( float ) volatile;
};
      
291 - a constructor cannot be 'virtual'
Virtual functions can't be called for an object before it's constructed. For this reason, a virtual constructor isn't allowed in the C++ language. Techniques for simulating a virtual constructor are known; one such technique is described in the Annotated C++ Reference Manual p.263. For example:

class C {
public:
   virtual C( int );
};
      
292 - types do not match in simple type destructor
A simple type destructor is available for destroying simple types. The destructor has no effect. Both of the types must be identical for the destructor to have meaning. For example:

void foo( int *p )
{
    p->int::~double();
}
      
293 - overloaded operator is ambiguous for operands used
The Watcom C++ compiler performs exhaustive analysis using formalized techniques in order to decide what implicit conversions should be applied for overloading operators. Because of this, Watcom C++ detects ambiguities that may escape other C++ compilers. The most common ambiguity that Watcom C++ detects involves classes having constructors with single arguments and a user-defined conversion. For example:

struct S {
    S(int);
    operator int();
    int a;
};

int fn( int b, int i, S s )
{
    //      i    : s.operator int()
    // OR S(i) : s
    return b ? i : s;
}
      

In the above example, i and s must be brought to a common type. Unfortunately, there are two common types, so the compiler can't decide which one it should choose, hence an ambiguity results.

294 - feature not implemented
The compiler doesn't support the indicated feature.
295 - invalid friend declaration
This message indicates that the compiler found extra declaration specifiers like auto, float, or const in the friend declaration. For example:

class C
{
    friend float;
};
      
296 - friend declarations may only be declared in a class
This message indicates that a friend declaration was found outside a class scope (that is, a class definition). Friends are only meaningful for class types. For example:

extern void foo();
friend void foo();
      
297 - class friend declaration needs 'class' or 'struct' keyword
The C++ language has evolved to require that all friend class declarations be of the form class S or struct S. The Watcom C++ compiler accepts the older syntax with a warning, but rejects the syntax in pure ANSI C++ mode. For example:

struct S;
struct T {
    friend S;    // should be "friend class S;"
};
      
298 - class friend declarations cannot contain a class definition
A class friend declaration can't define a new class. This is a restriction required in the C++ language. For example:

struct S {
    friend struct X {
    int f;
    };
};
      
299 - '%T' has already been declared as a friend
The class in the message has already been declared as a friend. Remove the extra friend declaration. For example:

class S;
class T {
    friend class S;
    int tv;
    friend class S;
};
      

Diagnostic messages 300-399

300 - function '%S' has already been declared as a friend
The function in the message has already been declared as a friend. Remove the extra friend declaration. For example:

extern void foo();
class T {
    friend void foo();
    int tv;
    friend void foo();
};
      
301 - 'friend', 'virtual' or 'inline' modifiers are not part of a function's type
This message indicates that the modifiers may be incorrectly placed in the declaration. If the declaration is intended, it can't be accepted because the modifiers can only be applied to functions that have code associated with them. For example:

typedef friend (*PF)( void );
      
302 - cannot assign right expression to element on left
This message indicates that the assignment can't be performed. It usually arises in assignments of a class type to an arithmetic type. For example:

struct S
{   int sv;
};
S s;
int foo()
{
    int k;
    k = s;
    return k;
}
      
303 - constructor is ambiguous for operands used
The operands provided for the constructor didn't select a unique constructor. For example:

struct S {
    S(int);
    S(char);
};

S x = S(1.0);
      
304 - 'class %s' has not been defined
The name before a :: scope resolution operator must be defined unless a member pointer is being declared. For example:

struct S;

int S::* p;    // OK
int S::a = 1;    // Error!
      
305 - all bit-fields in a union must be named
This is a restriction in the C++ language. The same effect can be achieved with a named bit-field. For example:

union u
{   unsigned bit1 :10;
    unsigned :6;
};
      
306 - cannot convert expression to type of cast
The cast is trying to convert an expression to a completely unrelated type. There's no way the compiler can provide any meaning for the intended cast. For example:

struct T {
};

void fn()
{
    T y = (T) 0;
}
      
307 - conversion ambiguity: [expression] to [cast type]
The cast caused a constructor overload to occur. The operands provided for the constructor didn't select a unique constructor. For example:

struct S {
    S(int);
    S(char);
};

void fn()
{
    S x = (S) 1.0;
}
      
308 - an anonymous class without a declarator is useless
There's no way to reference the type in this kind of declaration. A name must be provided for either the class or a variable using the class as its type. For example:

struct {
    int a;
    int b;
};
      
309 - global anonymous union must be declared 'static'
This is a restriction in the C++ language. Since there's no unique name for the anonymous union, it's difficult for C++ translators to provide a correct implementation of external linkage anonymous unions. For example:

static union {
   int a;
   int b;
};
      
310 - anonymous struct/union cannot have storage class in this context
Anonymous unions (or structs) declared in class scopes can't be static. Any other storage class is also disallowed. For example:

struct S {
   static union {
     int iv;
     unsigned us;
   };
};
      
311 - union contains a 'protected' member
A union can't have a protected member because a union can't be a base class. For example:

static union {
    int iv;
protected:
    unsigned sv;
} u;
      
312 - anonymous struct/union contains a private member '%S'
An anonymous union (or struct) can't have member functions or friends, so it can't have private members, since no code could access them. For example:

static union {
    int iv;
private:
    unsigned sv;
};
      
313 - anonymous struct/union contains a function member '%S'
An anonymous union (or struct) can't have any function members. This is a restriction in the C++ language. For example:

static union {
    int iv;
    void foo();     // error
    unsigned sv;
};
      
314 - anonymous struct/union contains a typedef member '%S'
An anonymous union (or struct) can't have any nested types. This is a restriction in the C++ language. For example:

static union {
    int iv;
    unsigned sv;
    typedef float F;
    F fv;
};
      
315 - anonymous struct/union contains an enumeration member '%S'
An anonymous union (or struct) can't have any enumeration members. This is a restriction in the C++ language. For example:

static union {
    int iv;
    enum choice { good, bad, indifferent };
    choice c;
    unsigned sv;
};
      
316 - anonymous struct/union member '%s' is not distinct in enclosing scope
Since an anonymous union (or struct) provides its member names to the enclosing scope, the names must not collide with other names in the enclosing scope. For example:

int iv;
unsigned sv;
static union {
    int iv;
    unsigned sv;
};
      
317 - unions cannot have members with destructors
A union should only be used to organize memory in C++. Allowing union members to have destructors would mean that the same piece of memory could be destroyed twice. For example:

struct S {
    int sv1, sv2, sv3;
};
struct T {
    ~T();
};
static union
{
    S su;
    T tu;
};
      
318 - unions cannot have members with user-defined assignment operators

A union should only be used to organize memory in C++. Allowing union members to have assignment operators would mean that the same piece of memory could be assigned twice. For example:

struct S {
    int sv1, sv2, sv3;
};
struct T {
    int tv;
    operator = ( int );
    operator = ( float );
};
static union
{
    S su;
    T tu;
} u;
      
319 - anonymous struct/union cannot have any friends
An anonymous union (or struct) can't have any friends. This is a restriction in the C++ language. For example:

struct S {
    int sv1, sv2, sv3;
};
static union {
    S su1;
    S su2;
    friend class S;
};
      
320 - specific versions of template classes can only be defined in file scope
Currently, specific versions of class templates can only be declared at file scope. This simple restriction was chosen in favor of more freedom with possibly subtle restrictions. For example:

template <class G> class S {
    G x;
};

struct Q {
    struct S<int> {
    int x;
    };
};

void foo()
{
    struct S<double> {
    double x;
    };
}
      
321 - anonymous union in a function may only be 'static' or 'auto'
The current C++ language definition only allows auto anonymous unions. The Watcom C++ compiler allows static anonymous unions. Any other storage class isn't allowed.
322 - static data members are not allowed in a local class
Static data members aren't allowed in a local class because there is no way to define the static member in file scope. For example:

int foo()
{
    struct local {
      static int s;
    };

    local lv;

    lv.s = 3;
    return lv.s;
}
      
323 - conversion ambiguity: [return value] to [return type of function]
The cast caused a constructor overload to occur. The operands provided for the constructor didn't select a unique constructor. For example:

struct S {
    S(int);
    S(char);
};

S fn()
{
return 1.0;
}
      
324 - conversion of return value is impossible
The return is trying to convert an expression to a completely unrelated type. There's no way the compiler can provide any meaning for the intended return type. For example:

struct T {
};

T fn()
{
    return 0;
}
      
325 - function cannot return a pointer based on __self
A function can't return a pointer that is based on __self. For example:

void __based(__self) *fn( unsigned );
      
326 - defining '%S' is not possible because its type has unknown size
In order to define a variable, the size must be known, so that the correct amount of storage can be reserved. For example:

class S;
S sv;
      
327 - a typedef cannot be initialized
Initializing a typedef is meaningless in the C++ language. For example:

typedef int INT = 15;
      
328 - storage class of '%S' conflicts with previous declaration
The symbol declaration conflicts with a previous declaration with regard to storage class. A symbol can't be both static and extern.
329 - modifiers of '%S' conflict with previous declaration
The symbol declaration conflicts with a previous declaration with regard to modifiers. Correct the program by using the same modifiers for both declarations.
330 - a function cannot be initialized
A function can't be initialized with an initializer syntax intended for variables. A function body is the only way to provide a definition for a function.
331 - access permission of nested class '%T' conflicts with previous declaration
For example:

struct S {
    struct N;    // public
private:
    struct N {    // private
    };
};
      
332 - *** FATAL *** internal error in front end
If this message appears, please report the problem directly to QNX Software Systems Limited.
333 - cannot convert argument to type specified in function prototype
It's impossible to convert the indicated argument in the function. For example:

extern int foo( int& );

extern int m;
extern int n;

int k = foo( m + n );
      

In the example, the value of m+n can't be converted to a reference. It could be converted to a constant reference, as shown in the following example:

extern int foo( const int& );

extern int m;
extern int n;

int k = foo( m + n );
      
334 - conversion ambiguity: [argument] to [argument type in prototype]
An argument in the function call couldn't be converted, since there's more than one constructor or user-defined conversion that could be used to convert the argument. For example:

struct S;

struct T
{
    T( S& );
};

struct S
{
    operator T();
};

S s;
extern int foo( T );
int k = foo( s );   // ambiguous
      

In the example, the argument s could be converted by both the constructor in class T and by the user-conversion in class S.

335 - cannot be based on based pointer '%S'
A based pointer can't be based on another based pointer. For example:

__segment s;
void __based(s) *p;
void __based(p) *q;
      
336 - declaration specifiers are required to declare '%N'
The compiler has detected that the name doesn't represent a function. Only function declarations can leave out declaration specifiers. This error also shows up when a typedef name declaration is missing. For example:

x;
typedef int;
      
337 - nested functions are not allowed
The C++ language doesn't allow functions to be nested within each other. The only way to achieve a limited form of this is to define a local class with inline member functions. For example:

struct S
{
    void foo()
    {
    static int nested_fun();
    }
};
      
338 - cannot define a __based reference
A C++ reference can't be based on anything. Based modifiers can only be used with pointers. For example:

__segment s;
void fn( int __based(s) & x );
      
339 - conversion ambiguity: conversion to common pointer type
A conversion to a common base class of two different pointers has been attempted. The pointer conversion couldn't be performed because the destination type points to an ambiguous base class of one of the source types.
340 - cannot construct object from argument(s)
There isn't an appropriate constructor for the set of arguments provided.
341 - number of arguments for function '%S' is incorrect
The number of arguments in the function call doesn't match the number declared for the indicated non-overloaded function. For example:

extern int foo( int, int );
int k = foo( 1, 2, 3 );
      

In the example, the function was declared to have two arguments. Three arguments were used in the call.

342 - private base class accessed to convert cast expression
A conversion involving the inheritance hierarchy required access to a private base class. The access check didn't succeed, so the conversion isn't allowed. For example,

struct Priv
{
    int p;
};
struct Der : private Priv
{
    int d;
};

extern Der *pd;
Priv *pp = (Priv*)pd;
      
343 - private base class accessed to convert return expression
A conversion involving the inheritance hierarchy required access to a private base class. The access check didn't succeed, so the conversion isn't allowed. For example:

struct Priv
{
    int p;
};
struct Der : private Priv
{
    int d;
};

Priv *foo( Der *p )
{
    return p;
}
      
344 - cannot subtract pointers to different objects
Pointer subtraction can be performed only for objects of the same type. For example:

#include <stddef.h>
ptrdiff_t diff( float *fp, int *ip )
{
    return fp - ip;
}
      

In the example, a diagnostic results from the attempt to subtract a pointer to an int object from a pointer to a float object.

345 - private base class accessed to convert to common pointer type
A conversion involving the inheritance hierarchy required access to a private base class. The access check didn't succeed, so the conversion isn't allowed. For example:

struct Priv
{
    int p;
};
struct Der : private Priv
{
    int d;
};

int foo( Der *pd, Priv *pp )
{
    return pd == pp;
}
      
346 - protected base class accessed to convert cast expression
A conversion involving the inheritance hierarchy required access to a protected base class. The access check didn't succeed, so the conversion isn't allowed. For example:

struct Prot
{
    int p;
};
struct Der : protected Prot
{
    int d;
};

extern Der *pd;
Prot *pp = (Prot*)pd;
      
347 - protected base class accessed to convert return expression
A conversion involving the inheritance hierarchy required access to a protected base class. The access check didn't succeed, so the conversion isn't allowed. For example:

struct Prot
{
    int p;
};
struct Der : protected Prot
{
    int d;
};

Prot *foo( Der *p )
{
    return p;
}
      
348 - cannot define a member pointer with a memory model modifier
A member pointer describes how to access a field from a class. Because of this a member pointer must be independent of any memory model considerations. For example:

struct S;

int near S::*mp;
      
349 - protected base class accessed to convert to common pointer type
A conversion involving the inheritance hierarchy required access to a protected base class. The access check didn't succeed, so the conversion isn't allowed. For example:

struct Prot
{
    int p;
};
struct Der : protected Prot
{
    int d;
};

int foo( Der *pd, Prot *pp )
{
    return pd == pp;
}
      
350 - non-type parameter supplied for a type argument
A non-type parameter (for example, an address or a constant expression) has been supplied for a template type argument. A type should be used instead.
351 - type parameter supplied for a non-type argument
A type parameter (for example, int) has been supplied for a template non-type argument. An address or a constant expression should be used instead.
352 - cannot access enclosing function's auto variable '%S'
A local class member function can't access its enclosing function's automatic variables. For example:

void goop( void )
{
    int a;
    struct S
    {
    int foo( int c, int b )
        {
          return b + c + a;
        };
    };
}
      
353 - cannot initialize pointer to non-constant with a pointer to constant
A pointer to a non-constant type can't be initialized with a pointer to a constant type because this would allow constant data to be modified via the non-constant pointer to it. For example:

extern const int *pic;
extern int *pi = pic;
      
354 - unsigned or pointer expression is always >= 0
The indicated expression will always be true because the value is always treated as an unsigned quantity, which is greater than or equal to zero. For example:

extern unsigned j;
unsigned i = ( j >= 0 );    // always 1
extern char *p;
unsigned k = ( 0 <= p );    // always 1
      
355 - unsigned or pointer expression is never < 0
The indicated expression will always be false because the value is always treated as an unsigned quantity, which is greater than or equal zero. For example:

extern unsigned j;
unsigned i = ( j < 0 );    // always 0
extern char *p;
unsigned k = ( 0 >= p );   // always 0
      
356 - a type cannot be used in this context
This message is issued when a type name is being used in a context where a non-type name should be used. For example:

struct S {
    typedef int T;
};

void fn( S *p )
{
    p->T = 1;
}
      
357 - a virtual function may only be declared in a class
Virtual functions can only be declared inside of a class. This error may be a result of forgetting the C:: qualification of a virtual function's name. For example:

virtual void foo();
struct S
{
    int f;
    virtual void bar();
};
virtual void bar()
{
    f = 9;
}
      
358 - '%T' referenced as a union
A class type defined as a class or struct has been referenced as a union (that is, union S). For example:

struct S
{
    int s1, s2;
};
union S var;
      
359 - 'union %T' referenced as a class
A class type defined as a union has been referenced as a struct or a class (that is, class S). For example:

union S
{
    int s1, s2;
};
struct S var;
      
360 - cannot define a pointer to an array of unknown dimension
A pointer to an array of unknown dimension isn't currently allowed in the C++ language. This is a known incompatibility with C, but it was disallowed in order to simplify function overloading. For example:

int (*p)[ ];
      
361 - function members must be inline in a local class
Member functions of local classes must be inline because C++ doesn't allow nested function definitions. For example:

void foo()
{
    struct S
    {
        int bar();
    };
}
      
362 - a local class can only have its containing function as a friend
A local class can only be referenced from within its containing function. It's impossible to define an external function that can reference the type of the local class. For example:

extern void ext();
void foo()
{
    class S
    {
        int s;
    public:
        friend void ext();
    int q;
    };
}
      
363 - local class cannot have '%S' as a friend
The only classes that a local class can have as a friend are classes within its own containing scope. For example:

struct ext
{
    goop();
};
void foo()
{
    class S
    {
    int s;
    public:
    friend class ext;
    int q;
    };
}
      
364 - adjacent !=, >=, <=, >, < operators
This message is warning about the possibility that the code might not do what was intended. An expression like a > b > c evaluates one relational operator to a 1 or a 0, and then compares it against the other variable. For example:

extern int a;
extern int b;
extern int c;
int k = a > b > c;
      
365 - cannot access enclosing function's argument '%S'
A local class member function can't access its enclosing function's arguments. For example:

void goop( int d )
{
    struct S
    {
    int foo( int c, int b )
        {
          return b + c + d;
        };
    };
}
      
366 - support for switch '%s' is not implemented
Actions for the indicated switch haven't been implemented. The switch is supported for compatibility with the Watcom C compiler.
367 - conditional expression in if statement is always true
The compiler has detected that the expression is always true. If this isn't the expected behaviour, the code may contain a comparison of an unsigned value against zero (for example, unsigned integers are always greater than or equal to zero). Comparisons against zero for addresses can also result in trivially true expressions. For example:

#define TEST 143
int foo( int a, int b )
{
    if( TEST ) return a;
      return b;
}
      
368 - conditional expression in if statement is always false
The compiler has detected that the expression is always false. If this isn't the expected behaviour, the code may contain a comparison of an unsigned value against zero (for example, unsigned integers are always greater than or equal to zero). Comparisons against zero for addresses can also result in trivially false expressions. For example:

#define TEST 14-14
int foo( int a, int b )
{
    if( TEST ) return a;
      return b;
}
      
369 - selection expression in switch statement is a constant value
The expression in the switch statement is a constant. This means that only one case label is executed. If this isn't the expected behaviour, check the switch expression. For example:

#define TEST 0
int foo( int a, int b )
{
    switch ( TEST ) {
      case 0:
        return a;
      default:
        return b;
    }
}
      
370 - a constructor is required for a class with a const member
If a class has a constant member, a constructor is required in order to initialize it. For example:

struct S
{
    const int s;
    int i;
};
      
371 - a constructor is required for a class with a reference member
If a class has a reference member, a constructor is required in order to initialize it. For example:

struct S
{
    int& r;
    int i;
};
      
372 - inline member friend function '%S' is not allowed
A friend that is a member function of another class can't be defined. Inline friend rules are currently in flux, so it's best to avoid them.
373 - memory model modifiers are not allowed for auto variables
An automatic variable can't have a memory model adjustment because they're always located on the stack (or in a register).
374 - object (or object pointer) required to access non-static data member
A reference to a member in a class has occurred. The member is non-static, so in order to access it, an object of the class is required. For example:

struct S {
    int m;
    static void fn()
    {
        m = 1;    // Error!
    }
};
      
375 - user-defined conversion has not been declared
The named user-defined conversion hasn't been declared in the class of any of its base classes. For example:

struct S {
    operator int();
    int a;
};

double fn( S *p )
{
    return p->operator double();
}
      
376 - a virtual function must be a non-static member function
A member function can't be both a static function and a virtual function. A static member function doesn't have a this argument, whereas a virtual function must have a this argument so that the virtual function table can be accessed in order to call it. For example:

struct S
{
    static virtual int foo();    // error
    virtual int bar();    // ok
    static int stat();    // ok
};
      
377 - protected base class accessed to convert argument expression
An automatic conversion involving the inheritance hierarchy required access to a protected base class. The access check didn't succeed, so the conversion isn't allowed. For example:

class C
{
protected:
    C( int );
public:
    int c;
};

int cfun( C );

int i = cfun( 14 );
      

The last line is erroneous, since the constructor is protected.

378 - private base class accessed to convert argument expression
A conversion involving the inheritance hierarchy required access to a private base class. The access check didn't succeed, so the conversion isn't allowed. For example:

class C
{
    C( int );
public:
    int c;
};

int cfun( C );

int i = cfun( 14 );
      

The last line is erroneous, since the constructor is private.

379 - 'delete' expression will invoke a non-virtual destructor
In C++, you can assign to a base class pointer the value of a derived class pointer, so that you can use code that makes use of base class virtual functions. A problem that occurs is that a delete has to know the correct size of the type in some instances (that is, when a two-argument version of operator delete is defined for a class).

This problem is solved by requiring that a destructor be defined as virtual if polymorphic deletions must work. The delete expression will virtually call the correct destructor, which knows the correct size of the complete object.

This message informs you that the class you're deleting has virtual functions but it has a non-virtual destructor. This means that the delete won't work correctly in all circumstances. For example:

#include <stddef.h>

struct B {
    int b;
    void operator delete( void *, size_t );
    virtual void fn();
    ~B();
};
struct D : B {
    int d;
    void operator delete( void *, size_t );
    virtual void fn();
    ~D();
};

void dfn( B *p )
{
    delete p;    // could be a pointer to D!
}
      
380 - 'offsetof' is not allowed for a function
A member function doesn't have an offset like simple data members. If this is required, use a member pointer. For example:

#include <stddef.h>

struct S
{
    int fun();
};

int s = offsetof( S, fun );
      
381 - 'offsetof' is not allowed for an enumeration
An enumeration doesn't have an offset like simple data members. For example:

#include <stddef.h>

struct S
{
    enum SE { S1, S2, S3, S4 };
    SE var;
};

int s = offsetof( S, SE );
      
382 - 'offsetof' is not allowed for second operand
The second operand can't be used with offsetof. This message isn't normally generated; it's included to handle future extension of the C++ language.
383 - 'offsetof' isn't allowed for an undefined type
You can't take the offset of a member of an incomplete or partially defined type, because the storage layout isn't yet determined. For example:

#include <stddef.h>

struct S {
    int a;
    int b;
    int c[ offsetof( S, b ) ];
};
      
384 - attempt to override virtual function '%S' with a different return type
A function can't be overloaded with identical argument types and a different return type. This is due to the fact that the C++ language doesn't consider the function's return type when overloading.

The exception to this rule in the C++ language involves restricted changes in the return type of virtual functions. The derived virtual function's return type can be derived from the return type of the base virtual function. For example:

struct B {
    virtual B *fn();
};
struct D : B {
    virtual D *fn();
};
      
385 - attempt to overload function '%S' with a different return type
A function can't be overloaded with identical argument types and a different return type. This is due to the fact that the C++ language doesn't consider the function's return type when overloading. For example:

int foo( char );
unsigned foo( char );
      
386 - attempt to use pointer to undefined class
An attempt was made to indirect or increment a pointer to an undefined or incomplete class. Since the class is undefined, the size isn't known, so the compiler can't compile the expression properly. For example:

class C;
extern C* pc1;
C* pc2 = ++pc1;     // C not defined

int foo( C*p )
{
    return p->x;    // C not defined
}
      
387 - expression is useful only for its side effects
The indicated expression isn't meaningful. The expression, however, does contain one or more side effects. For example:

extern int* i;
void func()
{
    *(i++);
}
      

In the example, the expression is a reference to an integer that is meaningless in itself. The incrementation of the pointer in the expression is a side effect.

388 - integral constant will be truncated during assignment or initialization
This message indicates that the compiler knows that a constant value won't be preserved after the assignment. If this is acceptable, cast the constant value to the appropriate type in the assignment. For example:

unsigned char c = 567;
      
389 - integral value may be truncated during assignment or initialization
This message indicates that the compiler knows that all values won't be preserved after the assignment. If this is acceptable, cast the value to the appropriate type in the assignment. For example:

extern unsigned s;
unsigned char c = s;
      
390 - cannot generate default constructor to initialize '%T' since constructors were declared
A default constructor won't be generated by the compiler if there are already constructors declared. Try using default arguments to change one of the constructors to a default constructor, or define a default constructor explicitly. For example:

class C {
    C( const C& );
public :
    int c;
};
C cv;
      
391 - assignment found in boolean expression
This is a construct that can lead to errors if it was intended to be an equality test using the == operator:

int foo( int a, int b )
{
    if( a = b ) {
      return b;
    }
    return a;    // always return 1 ?
}
      
392 - '%F' defined %L
This informational message indicates where the symbol in question was defined. The message is displayed following an error or warning diagnostic for the symbol in question. For example:

static int a = 9;
int b = 89;
      

The variable a isn't referenced in the preceding example, and so, causes a warning to be generated. Following the warning, the informational message indicates the line at which a was declared.

393 - included from %F(%L)
This informational message indicates the line number of the file including the file in which an error or warning was diagnosed. A number of such messages allow you to trace back through the #include directives that are currently being processed.
394 - reference object must be initialized
A reference can't be set except through initialization. In addition, references can't be 0, so they must always be initialized. For example:

int & ref;
      
395 - identifiers that contain a double underscore '__' should be avoided ('%N')
Some C++ compilers use a double underscore __ to reserve a name for internal use. This message indicates that you may be using names that are reserved by the implementation. For example:

int __suspect_name = 9;
      
396 - 'main' cannot be overloaded
There can only be one entry point for a C++ program. The main() function can't be overloaded. For example:

int main();
int main( int );
      
397 - a 'new' expression cannot allocate a 'void'
Since the void type has no size, and there are no values of void type, you can't allocate an instance of void. For example:

void *p = new void;
      
398 - a 'new' expression cannot allocate a function
A function type can't be allocated, since there's no meaningful size that can be used. The new expression can allocate a pointer to a function. For example:

typedef int tdfun( int );
tdfun *tdv = new tdfun;
      
399 - 'new' expression allocates a 'const' or 'volatile' object
The pool of raw memory can't be guaranteed to support const or volatile semantics. Usually const and volatile are used for statically allocated objects. For example:

typedef const int con_int;
con_int* p = new con_int;
      

Diagnostic messages 400-499

400 - cannot convert right expression for initialization
The initialization is trying to convert an argument expression to a completely unrelated type. There's no way the compiler can provide any meaning for the intended conversion. For example:

struct T {
};

T x = 0;
      
401 - conversion ambiguity: [initialization expression] to [type of object]
The initialization caused a constructor overload to occur. The operands provided for the constructor didn't select a unique constructor. For example:

struct S {
    S(int);
    S(char);
};

S x = 1.0;
      
402 - class template '%S' has already been declared as a friend
The class template in the message has already been declared as a friend. Remove the extra friend declaration. For example:

template <class T>
    class S;

class X {
    friend class S;
    int f;
    friend class S;
};
      
403 - private base class accessed to convert initialization expression
A conversion involving the inheritance hierarchy required access to a private base class. The access check didn't succeed so the conversion isn't allowed.
404 - protected base class accessed to convert initialization expression
A conversion involving the inheritance hierarchy required access to a protected base class. The access check didn't succeed so the conversion isn't allowed.
405 - cannot return a pointer or reference to a constant object
A pointer or reference to a constant object can't be returned. For example:

int *foo( const int *p )
{
    return p;
}
      
406 - cannot pass a pointer or reference to a constant object
A pointer or reference to a constant object couldn't be passed as an argument. For example:

int *bar( int * );
int *foo( const int *p )
{
    return bar( p );
}
      
407 - class templates must be named
There's no syntax in the C++ language to refer to an unnamed class template. For example:

template <class T>
    class {
    };
      
408 - function templates can only name functions
Variables can't be overloaded in C++, so it isn't possible to have many different instances of a variable with different types. For example:

template <class T>
T x[1];
      
409 - template argument '%S' is not used in the function argument list
This restriction ensures that function templates can be bound to types during overload resolution. Functions currently can only be overloaded based on argument types. For example:

template <class T>
    int foo( int * );
template <class T>
    T bar( int * );
      
410 - destructor cannot be declared 'const' or 'volatile'
A destructor must be able to operate on all instances of classes regardless of whether they are const or volatile.
411 - static member function cannot be declared 'const' or 'volatile'
A static member function doesn't have an implicit this argument, so the const and volatile function qualifiers can't be used.
412 - only member functions can be declared 'const' or 'volatile'
A non-member function doesn't have an implicit this argument, so the const and volatile function qualifiers can't be used.
413 - 'const' or 'volatile' modifiers are not part of a function's type
The const and volatile qualifiers for a function can't be used in typedefs or pointers to functions. The trailing qualifiers are used to change the type of the implicit this argument so that member functions that don't modify the object can be declared accurately. For example:

// const is illegal
typedef void (*baddcl)() const;

struct S {
    void fun() const;
    int a;
};

// "this" has type "S const *"
void S::fun() const
{
    this->a = 1;    // Error!
}
      
414 - type cannot be defined in an argument
A new type can't be defined in an argument because the type is only visible within the function. This amounts to defining a function that can never be called, because C++ uses name equivalence for type checking. For example:

extern foo( struct S { int s; } );
      
415 - type cannot be defined or declared in a return type
This is a restriction in the current C++ language. A function prototype should only use previously declared types, in order to guarantee that it can be called from other functions. The restriction is required for templates because the compiler would have to wait until the end of a class definition before it could decide whether a class template or function template is being defined. For example:

template <class T>
    class C {
    T value;
    } fn( T x ) {
    C y;

    y.x = 0;
    return y;
    };
      

A common problem that results in this error is to forget to terminate a class or enum definition with a semicolon. For example:

struct S {
    int x,y;
    S( int, int );
} // missing semicolon ';'

S::S( int x, int y ) : x(x), y(y) {
}
      
416 - data members cannot be initialized inside a class definition
This message appears when an initialization is attempted inside of a class definition. In the case of static data members, initialization must be done outside the class definition. Ordinary data members can be initialized in a constructor. For example:

struct S {
    static const int size = 1;
};
      
417 - only virtual functions may be declared pure
The C++ language requires that all pure functions be declared virtual. A pure function establishes an interface that must consist of virtual functions because the functions are required to be defined in the derived class. For example:

struct S {
    void foo() = 0;
};
      
418 - destructor is not declared in its proper class
The destructor name isn't declared in its own class or qualified by its own class. This is required in the C++ language.
419 - cannot call non-const function for a constant object
A function that doesn't promise not to modify an object can't be called for a constant object. A function can declare its intention not to modify an object by using the const qualifier. For example:

struct S {
    void fn();
};

void cfn( const S *p )
{
    p->fn();    // Error!
}
      

If fn() is declared as voice fn() const;, then the example above is valid.

420 - a memory initializer list may only appear in a constructor definition
A memory initializer list should be declared along with the body of the constructor function.
421 - cannot initialize member '%N' twice
A member can't be initialized twice in a member initialization list.
422 - cannot initialize base class '%T' twice
A base class can't be constructed twice in a member initialization list.
423 - '%T' is not a direct base class
A base class initializer in a member initialization list must either be a direct base class or a virtual base class.
424 - '%N' cannot be initialized because it is not a member
The name used in the member initialization list doesn't name a member in the class.
425 - '%N' cannot be initialized because it is a member function
The name used in the member initialization list doesn't name a non-static data member in the class.
426 - '%N' cannot be initialized because it is a static member
The name used in the member initialization list doesn't name a non-static data member in the class.
427 - '%N' has not been declared as a member
This message indicates that the member doesn't exist in the qualified class. This usually occurs in the context of access declarations.
428 - member '%S' does not have an initializer
The const or reference member doesn't have an initializer, so the constructor isn't completely defined. Using the member initialization list is the only way to initialize these types of members.
429 - abstract class '%T' cannot be used as an argument type
An abstract class can only exist as a base class of another class. The C++ language doesn't allow an abstract class to be used as an argument type.
430 - abstract class '%T' cannot be used as a function return type
An abstract class can only exist as a base class of another class. The C++ language doesn't allow an abstract class to be used as a return type.
431 - defining '%S' is not possible because '%T' is an abstract class
An abstract class can only exist as a base class of another class. The C++ language doesn't allow an abstract class to be used as either a member or a variable.
432 - cannot convert to an abstract class '%T'
An abstract class can only exist as a base class of another class. The C++ language doesn't allow an abstract class to be used as the destination type in a conversion.
433 - mangled name for '%S' has been truncated
The name used in the object file that encodes the name and full type of the symbol is often called a mangled name. The warning indicates that the mangled name had to be truncated due to limitations in the object file format.
434 - cannot convert to a type of unknown size
A completely unknown type can't be used in a conversion because its size isn't known. The behaviour of the conversion would also be undefined.
435 - cannot convert a type of unknown size
A completely unknown type can't be used in a conversion because its size isn't known. The behaviour of the conversion would also be undefined.
436 - cannot construct an abstract class '%T'
An instance of an abstract class can't be created because an abstract class can only be used as a base class.
437 - cannot construct an undefined class '%T'
An instance of an undefined class can't be created because the size isn't known.
438 - string literal concatenated during array initialization
This message indicates that a missing comma (',') could have made a quiet change in the program. Otherwise, ignore this message.
439 - maximum size of segment '%s' has been exceeded for '%S'
The indicated symbol has grown in size to a point where it has caused the segment it's defined inside of to be exhausted.
440 - maximum data item size has been exceeded for '%S'
A non-huge data item is larger than 64k bytes in size. This message only occurs during 16-bit compilation of C++ code.
441 - a function attribute has been repeated
A function attribute (like the __export attribute) has been repeated. Remove the extra attribute to correct the declaration.
442 - a modifier has been repeated
A modifier (like the far modifier) has been repeated. Remove the extra modifier to correct the declaration.
443 - illegal combination of memory model modifiers
Memory model modifiers must be used individually because they can't be combined meaningfully.
444 - argument name '%N' has already been used
The indicated argument name has already been used in the same argument list. This isn't allowed in the C++ language.
445 - function definition for '%S' must be declared with an explicit argument list
A function can't be defined with a typedef. The argument list must be explicit.
446 - user-defined conversion cannot return its own class
A user-defined conversion can't return its own class because it would complicate implicit conversions during overloading.
447 - #pragma contains too many bytes
A code burst pragma can only contain 128 bytes of code.
448 - expecting identifier
An identifier was expected during processing.
449 - symbol '%S' does not have a segment associated with it
A pointer can't be based on a member because it has no segment associated with it. A member describes a layout of storage that can occur in any segment.
450 - symbol '%S' must have integral or pointer type
If a symbol is based on another symbol, it must be integral or a pointer type. An integral type indicates the segment value that is used. A pointer type means that all accesses are added to the pointer value to construct a full pointer.
451 - symbol '%S' cannot be accessed in all contexts
The symbol that the pointer is based on is in another class, so it can't be accessed in all contexts in which the based pointer can be accessed.
452 - cannot convert class expression to be copied
A convert class expression couldn't be copied.
453 - conversion ambiguity: multiple copy constructors
More than one constructor could be used to copy a class object.
454 - function template '%S' already has a definition
The function template has already been defined with a function body. A function template can't be defined twice even if the function body is identical. For example:

template <class T>
    void f( T *p )
    {
    }
template <class T>
    void f( T *p )
    {
    }
      
455 - function templates cannot have default arguments
A function template mustn't have default arguments because there are certain types of default arguments that don't force the function argument to be a specific type. For example:

template <class T>
    void f2( T *p = 0 )
    {
    }
      
456 - 'main' cannot be a function template
This is a restriction in the C++ language because main() can't be overloaded. A function template provides the possibility of having more than one main() function.
457 - '%S' was previously declared as a typedef
The C++ language only allows function and variable names to coexist with names of classes or enumerations. This is due to the fact that the class and enumeration names can still be referenced in their elaborated form after the non-type name has been declared. For example:

typedef int T;
int T( int )    // error!
{
}

enum E { A, B, C };
void E()
{
    enum E x = A;    // use "enum E"
}

class C { };
void C()
{
    class C x;    // use "class C"
}
      
458 - '%S' was previously declared as a variable/function
The C++ language only allows function and variable names to coexist with names of classes or enumerations. This is due to the fact that the class and enumeration names can still be referenced in their elaborated form after the non-type name has been declared. For example:

int T( int )
{
}
typedef int T;    // error!

void E()
{
}
enum E { A, B, C };

enum E x = A;    // use "enum E"

void C()
{
}
class C { };

class C x;    // use "class C"
      
459 - private base class accessed to convert assignment expression
A conversion involving the inheritance hierarchy required access to a private base class. The access check didn't succeed, so the conversion isn't allowed.
460 - protected base class accessed to convert assignment expression
A conversion involving the inheritance hierarchy required access to a protected base class. The access check didn't succeed, so the conversion isn't allowed.
461 - maximum size of DGROUP has been exceeded for '%S' in segment '%s'
The indicated symbol's size has caused the DGROUP contribution of this module to exceed 64k. Changing memory models or declaring some data as far data are two ways of fixing this problem.
462 - type of return value is not the enumeration type of function
The return value doesn't have the proper enumeration type. Keep in mind that integral values aren't automatically converted to enum types as in the C language.
463 - linkage must be first in a declaration; probable cause: missing ';'
This message usually indicates a missing semicolon (;). The linkage specification must be the first part of a declaration if it's used.
464 - 'main' cannot be a static function
This is a restriction in the C++ language because main() must have external linkage.
465 - 'main' cannot be an inline function
This is a restriction in the C++ language because main() must have external linkage.
466 - 'main' cannot be referenced
This is a restriction in the C++ language to prevent implementations from having to work around multiple invocations of main(). This can occur if an implementation has to generate special code in main() to construct all of the statically allocated classes.
467 - cannot call a non-volatile function for a volatile object
A function that doesn't promise not to modify an object using volatile semantics can't be called for a volatile object. A function can declare its intention to modify an object only through volatile semantics by using the volatile qualifier. For example:

struct S {
    void fn();
};

void cfn( volatile S *p )
{
    p->fn();    // Error!
}
      
468 - cannot convert pointer to constant or volatile objects to 'void*'
You can't convert a pointer to constant or volatile objects to void*. For example:

extern const int* pci;
extern void *vp;

int k = ( pci == vp );
      
469 - cannot convert pointer to constant or non-volatile objects to 'volatile void*'
You can't convert a pointer to constant or non-volatile objects to volatile void*. For example:

extern const int* pci;
extern volatile void *vp;

int k = ( pci == vp );
      
470 - address of function is too large to be converted to 'void*'
The address of a function can be converted to void* only when the size of a void* object is large enough to contain the function pointer. For example:

void __far foo();
void __near *v = &foo;
      
471 - address of data object is too large to be converted to 'void*'
The address of an object can be converted to void* only when the size of a void* object is large enough to contain the pointer. For example:

int __far *ip;
void __near *v = ip;
      
472 - expression with side effect in 'sizeof' discarded
The indicated expression is discarded; consequently, any side effects in it won't be executed. For example:

int a = 14;
int b = sizeof( a++ );
      

In the example, the variable a still has a value of 14 after b has been initialized.

473 - function argument(s) do not match those in prototype
The C++ language requires great precision in specifying arguments for a function. For instance, a pointer to char is considered different from a pointer to unsigned char even if char is an unsigned quantity. This message occurs when a non-overloaded function is invoked and one or more of the arguments can't be converted. It also occurs when the number of arguments differs from the number specified in the prototype.
474 - conversion ambiguity: [expression] to [class object]
The conversion of the expression to a class object is ambiguous.
475 - cannot assign right expression to class object
The expression on the right can't be assigned to the indicated class object.
476 - argument count is %d since there is an implicit 'this' argument
This informational message indicates the number of arguments for the function mentioned in the error message. The function is a member function with a this argument, so it may have one more argument than expected.
477 - argument count is %d since there is no implicit 'this' argument
This informational message indicates the number of arguments for the function mentioned in the error message. The function is a member function without a this argument so it may have one less argument than expected.
478 - argument count is %d for a non-member function
This informational message indicates the number of arguments for the function mentioned in the error message. The function isn't a member function but it could be declared as a friend function.
479 - conversion ambiguity: multiple copy constructors to copy array '%S'
There's more than one constructor to copy the indicated array.
480 - variable/function has the same name as the class/enum '%S'
In C++, a class or enum name can coexist with a variable or function of the same name in a scope. This warning indicates that the current declaration is making use of this feature, but the typedef name is declared in another file. This usually means that there are two unrelated uses of the same name.
481 - class/enum has the same name as the function/variable '%S'
In C++, a class or enum name can coexist with a variable or function of the same name in a scope. This warning indicates that the current declaration is making use of this feature, but the function/variable name is declared in another file. This usually means that there are two unrelated uses of the same name.

Furthermore, all references to the class or enum must be elaborated (that is, use class C instead of C) in order for subsequent references to be compiled properly.

482 - cannot create a default constructor
A default constructor couldn't be created, because other constructors were declared for the class in question. For example:

struct X {
    X(X&);
};
struct Y {
    X a[10];
};
Y yvar;
      

In the example, the variable yvar causes a default constructor for the class Y to be generated. The default constructor for Y attempts to call the default constructor for X in order to initialize the array a in class Y. The default constructor for X can't be defined because another constructor has been declared.

483 - attempting to access default constructor for %T
This informational message indicates that a default constructor was referenced but couldn't be generated.
484 - cannot align symbol '%S' to segment boundary
The indicated symbol requires more than one segment of storage, and the symbol's components can't be aligned to the segment boundary.
485 - friend declaration does not specify a class or function
A class or function must be declared as a friend. For example:

struct T {
    // should be class or function declaration
    friend int;
};
      
486 - cannot take address of overloaded function
This message indicates that an overloaded function's name was used in a context where a final type couldn't be found. Because a final type wasn't specified, the compiler can't select one function to use in the expression. Initialize a properly-typed temporary with the appropriate function and use the temporary in the expression. For example:

int foo( char );
int foo( unsigned );
extern int (*p)( char );
int k = ( p == &foo );        // fails
      

The first foo can be passed as follows:

int foo( char );
int foo( unsigned );
extern int (*p)( char );

// introduce temporary
static int (*temp)( char ) = &foo;

// ok
int k = ( p == temp );
      
487 - cannot use address of overloaded function as a variable argument
This message indicates that an overloaded function's name was used as a argument for a ... style function. Because a final function type isn't present, the compiler can't select one function to use in the expression. Initialize a properly-typed temporary with the appropriate function and use the temporary in the call. For example:

int foo( char );
int foo( unsigned );
int ellip_fun( int, ... );
int k = ellip_fun( 14, &foo );    // fails
      

The first foo can be passed as follows:

int foo( char );
int foo( unsigned );
int ellip_fun( int, ... );

static int (*temp)( char ) = &foo;  // introduce temporary

int k = ellip_fun( 14, temp );    // ok
      
488 - '%N' cannot be overloaded
The indicated function can't be overloaded. Functions that fall into this category include operator delete.
489 - symbol '%S' has already been initialized
The indicated symbol has already been initialized. It can't be initialized twice even if the initialization value is identical.
490 - 'delete' expression is a pointer to a function
A pointer to a function can't be allocated, so it can't be deleted.
491 - cannot delete pointer to constant data
A pointer to constant data can't be allocated, so it can't be deleted.
492 - 'delete' expression is not a pointer to data
A delete expression can only delete pointers. For example, trying to delete an int isn't allowed in the C++ language:

void fn( int a )
{
    delete a;    // Error!
}
      
493 - template argument is not a constant expression
The compiler has found an incorrect expression provided as the value for a constant value template argument. The only expressions allowed for scalar template arguments are integral constant expressions.
494 - template argument is not an external linkage symbol
The compiler has found an incorrect expression provided as the value for a pointer value template argument. The only expressions allowed for pointer template arguments are addresses of symbols. Any symbols must have external linkage or must be static class members.
495 - conversion of const reference to volatile reference
The constant value can be modified by assigning into the volatile reference. This would allow constant data to be modified quietly. For example:

void fn( const int &rc )
{
    int volatile &r = rc;    // Error!
}
      
496 - conversion of volatile reference to const reference
The volatile value can be read incorrectly by accessing the const reference. This would allow volatile data to be accessed without correct volatile semantics. For example:

void fn( volatile int &rv )
{
    int const &r = rv;    // Error!
}
      
497 - conversion of const or volatile reference to plain reference
The constant value can be modified by assigning into the plain reference. This would allow constant data to be modified quietly. In the case of volatile data, any access to the plain reference won't respect the volatility of the data and thus would be incorrectly accessing the data. For example:

void fn( const int &rc, volatile int &rv )
{
    int &r1 = rc;    // Error!
    int &r2 = rv;    // Error!
}
      
498 - syntax error before '%s'; probable cause: incorrectly spelled type name
The identifier in the error message hasn't been declared as a type name in any scope at this point in the code. This may be the cause of the syntax error.
499 - object (or object pointer) required to access non-static member function
A reference to a member function in a class has occurred. The member is non-static, so in order to access it, an object of the class is required. For example:

struct S {
    int m();
    static void fn()
    {
    m();    // Error!
    }
};
      

Diagnostic messages 500-599

500 - object (or object pointer) cannot be used to access function
The indicated object (or object pointer) can't be used to access function.
501 - object (or object pointer) cannot be used to access data
The indicated object (or object pointer) can't be used to access data.
502 - cannot access member function in enclosing class
A member function in the enclosing class can't be accessed.
503 - cannot access data member in enclosing class
A data member in the enclosing class can't be accessed.
504 - syntax error before type name '%s'
The identifier in the error message has been declared as a type name at this point in the code. This may be the cause of the syntax error.
505 - implementation restriction: cannot generate thunk from '%S' to '%S'
This implementation restriction is due to the use of a shared code generator between Watcom compilers. The virtual this adjustment thunks are generated as functions linked into the virtual function table. The functions rely on knowing the correct number of arguments to pass on to the overriding virtual function but in the case of ellipsis (...) functions, the number of arguments can't be known when the thunk function is being generated by the compiler.

The workaround for this problem is to recode the source so that the virtual functions make use of the va_list type found in the stdarg.h header file. For example:

#include <iostream.h>
#include <stdarg.h>

struct B {
    virtual void fun( char *, ... );
};
struct D : B {
    virtual void fun( char *, ... );
};
void B::fun( char *f, ... )
{
    va_list args;

    va_start( args, f );
    while( *f ) {
        cout << va_arg( args, char ) << endl;
        ++f;
    }
    va_end( args );
}
void D::fun( char *f, ... )
{
    va_list args;

    va_start( args, f );
    while( *f ) {
        cout << va_arg( args, int ) << endl;
        ++f;
    }
    va_end( args );
}
      

The previous example can be changed to the following code with corresponding changes to the contents of the virtual functions:

#include <iostream.h>
#include <stdarg.h>

struct B {
    void fun( char *f, ... )
    {
    va_list args;

    va_start( args, f );
    _fun( f, args );
    va_end( args );
    }
    virtual void _fun( char *, va_list );
};

struct D : B {
    // this can be removed since using B::fun
    // results in the same behaviour
    // since _fun is a virtual function
    void fun( char *f, ... )
    {
    va_list args;

    va_start( args, f );
    _fun( f, args );
    va_end( args );
    }
    virtual void _fun( char *, va_list );
};

void B::_fun( char *f, va_list args )
{
    while( *f ) {
        cout << va_arg( args, char ) << endl;
        ++f;
    }
}

void D::_fun( char *f, va_list args )
{
    while( *f ) {
        cout << va_arg( args, int ) << endl;
        ++f;
    }
}


// no changes are required for users of the class
B x;
D y;

void dump( B *p )
{
    p->fun( "1234", 'a', 'b', 'c', 'd' );
    p->fun( "12", 'a', 'b' );
}


void main()
{
    dump( &x );
    dump( &y );
}
      
506 - conversion of __based( void ) pointer to virtual base class
A __based(void) pointer to a class object can't be converted to a pointer to virtual base class, since this conversion applies only to specific objects. For example:

struct Base {};
struct Derived : virtual Base {};
Derived __based( void ) *p_derived;
Base __based( void ) *p_base = p_derived; // error
      

The conversion would be allowed if the base class weren't virtual.

507 - class for left operand is not derived from class for right operand
A member pointer conversion can only be performed safely when converting a base class member pointer to a derived class member pointer.
508 - conversion ambiguity: [pointer to class member] to [assignment object]

The base class in the original member pointer isn't a unique base class of the derived class.

509 - conversion of pointer to class member involves a private base class
The member pointer conversion required access to a private base class. The access check didn't succeed, so the conversion isn't allowed.
510 - conversion of pointer to class member involves a protected base class
The member pointer conversion required access to a protected base class. The access check didn't succeed, so the conversion isn't allowed.
511 - item is neither a non-static member function nor data member
A member pointer can only be created for non-static member functions and non-static data members. Static members can have their address taken just like their file scope counterparts.
512 - function address cannot be converted to pointer to class member
The indicated function address can't be converted to a pointer to a class member.
513 - conversion ambiguity: [address of function] to [pointer to class member]
The indicated conversion is ambiguous.
514 - addressed function is in a private base class
The addressed function is in a private base class.
515 - addressed function is in a protected base class
The addressed function is in a protected base class.
516 - class for object is not defined
The left hand operand for the . or .* operator must be of a class type that is completely defined. For example:

class C;

int fun( C& x )
{
    return x.y;     // class C not defined
}
      
517 - left expression is not a class object
The left hand operand for the .* operator must be of a class type, since member pointers can only be used with classes.
518 - right expression is not a pointer to class member
The right hand operand for the .* operator must be a member pointer type.
519 - cannot convert pointer to class of member pointer
The class of the left hand operand can't be converted to the class of the member pointer because it isn't a derived class.
520 - conversion ambiguity: [pointer] to [class of pointer to class member]
The class of the pointer to member is an ambiguous base class of the left hand operand.
521 - conversion of pointer to class of member pointer involves a private base class
The class of the pointer to member is a private base class of the left hand operand.
522 - conversion of pointer to class of member pointer involves a protected base class
The class of the pointer to member is a protected base class of the left hand operand.
523 - cannot convert object to class of member pointer
The class of the left hand operand can't be converted to the class of the member pointer because it isn't a derived class.
524 - conversion ambiguity: [object] to [class object of pointer to class member]
The class of the pointer to member is an ambiguous base class of the left hand operand.
525 - conversion of object to class of member pointer involves a private base class
The class of the pointer to member is a private base class of the left hand operand.
526 - conversion of object to class of member pointer involves a protected base class
The class of the pointer to member is a protected base class of the left hand operand.
527 - conversion of pointer to class member from a derived to a base class
A member pointer can only be converted from a base class to a derived class. This is the opposite of the conversion rule for pointers.
528 - form is '#pragma inline_recursion en' where 'en' is 'on' or 'off'
This pragma indicates whether or not inline expansion occurs for an inline function that's called (possibly indirectly) a subsequent time during an inline expansion. Either on or off must be specified.
529 - expression for number of array elements must be integral
The expression for the number of elements in a new expression must be integral because it's used to calculate the size of the allocation (which is an integral quantity). The compiler doesn't automatically convert it to an integer because of rounding and truncation issues with floating-point values.
530 - function accessed with '.*' or '->*' can only be called
The result of the .* and ->* operators can only be called because it's often specific to the instance used for the left hand operand.
531 - left operand must be a pointer, pointer to class member, or arithmetic
The left operand must be a pointer, pointer to class member, or arithmetic.
532 - right operand must be a pointer, pointer to class member, or arithmetic
The right operand must be a pointer, pointer to class member, or arithmetic.
533 - neither pointer to class member can be converted to the other
The two member pointers being compared are from two unrelated classes. They can't be compared since their members can never be related.
534 - left operand is not a valid pointer to class member
The specified operator requires a pointer to member as the left operand. For example:

struct S;
void fn( int S::* mp, int *p )
{
    if( p == mp )
      p[0] = 1;
}
      
535 - right operand is not a valid pointer to class member
The specified operator requires a pointer to member as the right operand. For example:

struct S;
void fn( int S::* mp, int *p )
{
    if( mp == p )
        p[0] = 1;
}
      
536 - cannot use '.*' nor '->*' with pointer to class member with zero value
The compiler has detected a NULL pointer used with a member pointer dereference.
537 - operand is not a valid pointer to class member
The operand can't be converted to a valid pointer to class member. For example:

struct S;
int S::* fn()
{
    int a;
    return a;
}
      
538 - destructor can be invoked only with '.' or '->'
This is a restriction in the C++ language. An explicit invocation of a destructor isn't recommended for objects that have their destructor called automatically.
539 - class of destructor must be class of object being destructed
Destructors can only be called for the exact static type of the object being destroyed.
540 - destructor is not properly qualified
An explicit destructor invocation can only be qualified with its own class.
541 - pointers to class members reference different object types
Conversion of member pointers can only occur if the object types are identical. This is necessary to ensure type safety.
542 - operand must be pointer to class or struct
The left hand operand of a ->* operator must be a pointer to a class. This is a restriction in the C++ language.
543 - expression must have 'void' type
If one operand of the : operator has void type, then the other operand must also have void type.
544 - expression types do not match for ':' operator
The compiler couldn't bring both operands to a common type. This is necessary because the result of the conditional operator must be a unique type.
545 - cannot create an undefined type with 'operator new'
A new expression can't allocate an undefined type because it must know how large an allocation is required, and it must also know whether or not there are any constructors to execute.
546 - cannot delete a pointer to an undefined type
A delete expression can't deallocate an undefined type because it must know whether or not there are any destructors to execute.
547 - cannot access '%S' through a private base class
The indicated symbol can't be accessed because it requires access to a private base class.
548 - cannot access '%S' through a protected base class
The indicated symbol can't be accessed because it requires access to a protected base class.
549 - 'sizeof' operand contains compiler generated information
The type used in the sizeof() operand contains compiler-generated information. Clearing a struct with a call to memset() would invalidate all of this information.
550 - cannot convert ':' operands to a common reference type
The two reference types can't be converted to a common reference type. This can happen when the types aren't related through base class inheritance.
551 - conversion ambiguity: [reference to object] to [type of opposite ':' operand]
One of the reference types is an ambiguous base class of the other. This prevents the compiler from converting the operand to a unique common type.
552 - conversion of reference to ':' object involves a private base class
The conversion of the reference operands requires a conversion through a private base class.
553 - conversion of reference to ':' object involves a protected base class
The conversion of the reference operands requires a conversion through a protected base class.
554 - expression must have type arithmetic, pointer, or pointer to class member
This message also means that the type can't be converted to any of these types. All of the mentioned types can be compared against zero (0) to produce a true or false value.
555 - expression for 'while' is always false
The compiler has detected that the expression is always false. If this isn't the expected behaviour, the code may contain a comparison of an unsigned value against zero (for example, unsigned integers are always greater than or equal to zero). Comparisons against zero for addresses can also result in trivially false expressions.
556 - testing expression for 'for' is always false
The compiler has detected that the expression is always false. If this isn't the expected behaviour, the code may contain a comparison of an unsigned value against zero (for example, unsigned integers are always greater than or equal to zero). Comparisons against zero for addresses can also result in trivially false expressions.
557 - message number is invalid
The message number used in the #pragma doesn't match the message number for any warning message. This message can also indicate that a number or * (meaning all warnings) wasn't found when it was expected.
558 - warning level must be an integer in range 0 to 9
The new warning level that can be used for the warning can be in the range 0 to 9. The level 0 means that the warning is treated as an error (compilation won't succeed). Levels 1 up to 9 are used to classify warnings. The w option sets an upper limit on the level for warnings. By setting the level above the command-line limit, you effectively ignore all cases where the warning shows up.
559 - function '%S' cannot be defined because it is generated by the compiler
The indicated function can't be defined because it's generated by the compiler. The compiler automatically generates default constructors, copy constructors, assignment operators, and destructors according to the rules of the C++ language. This message indicates that you didn't declare the function in the class definition.
560 - neither environment variable nor file found for '@%s'
The indirection operator for the command line first checks for an environment variable of the name, and use the contents for the command line. If an environment variable isn't found, a check is made for a file with the same name.
561 - more than 5 indirections in command line encountered at '@%s'
The Watcom C++ compiler only allows a fixed number of file indirections to prevent runaway chains of indirections.
562 - cannot take address of non-static member function
The only way to create a value that describes the non-static member function is to use a member pointer.
563 - cannot generate default '%S' because class contains either a constant or a reference member
An assignment operator can't be generated because the class contains members that can't be assigned into.
564 - cannot convert pointer to non-constant or volatile objects to 'const void*'
A pointer to non-constant or volatile objects can't be converted to const void*.
565 - cannot convert pointer to non-constant or non-volatile objects to 'const volatile void*'
A pointer to non-constant or non-volatile objects can't be converted to const volatile void*.
566 - cannot initialize pointer to non-volatile with a pointer to volatile
A pointer to a non-volatile type can't be initialized with a pointer to a volatile type because this would allow volatile data to be modified without volatile semantics, via the non-volatile pointer to it.
567 - cannot pass a pointer or reference to a volatile object
A pointer or reference to a volatile object can't be passed in this context.
568 - cannot return a pointer or reference to a volatile object
A pointer or reference to a volatile object can't be returned.
569 - left expression is not a pointer to a volatile object
You can't assign a pointer to a volatile type to a pointer to a non-volatile type. This would allow a volatile object to be modified via the non-volatile pointer. Use a cast if this is absolutely necessary.
570 - virtual function override for '%S' is ambiguous; possible overrides include '%S' and '%S'
This message indicates that there are at least two overrides for the function in the base class. The compiler can't arbitrarily choose one, so it's up to you to make sure there's an unambiguous choice.
571 - initialization priority must be number 0-255, 'library', or 'program'
An incorrect module initialization priority has been provided. Check ``Setting priority of static data initialization'' in the following chapters for the correct format of the priority directive:
572 - previous 'case' label defined %L
This informational message indicates where a preceding case label is defined.
573 - previous 'default' label defined %L
This informational message indicates where a preceding default label is defined.
574 - label defined %L
This informational message indicates where a label is defined.
575 - label referenced %L
This informational message indicates where a label is referenced.
576 - object thrown has type: %T
This informational message indicates the type of the object being thrown.
577 - object thrown has an ambiguous base class %T
It's illegal to throw an object with a base class to which a conversion would be ambiguous. For example:

struct ambiguous{ };
struct base1 : public ambiguous { };
struct base2 : public ambiguous { };
struct derived : public base1, public base2 { };

foo( derived &object )
{
    throw object;
}
      

The throw causes an error to be displayed because an object of type derived can't be converted to an object of type ambiguous.

578 - form is '#pragma inline_depth level' where 'level' is 0 to 255
This pragma sets the number of times inline expansion occurs for an inline function that contains calls to inline functions. The level must be a number from zero to 255. When the level is zero, no inline expansion occurs.
579 - pointer or reference truncated by cast
The cast expression causes a conversion of a pointer value to another pointer value of smaller size. This can be caused by __near or __far qualifiers (that is, casting a far pointer to a near pointer). Function pointers can also have a different size than data pointers in certain memory models. Because this message indicates that some information is being lost, check the code carefully.
580 - cannot find a constructor for given initializer argument list
The initializer list provided for the new expression doesn't uniquely identify a single constructor.
581 - variable '%N' can only be based on a string in this context
All of the based modifiers can only be applied to pointer types. The only based modifier that can be applied to non-pointer types is the __based(__segname("WATCOM")) style.
582 - memory model modifiers are not allowed for class members
Class members describe the arrangement and interpretation of memory and, as such, assume the memory model of the address used to access the member.
583 - redefinition of the typedef name '%S' ignored
The compiler has determined that a slightly different type has been assigned to a typedef name. The type is functionally equivalent but typedef redefinitions should be precisely identical.
584 - constructor for variable '%S' may not execute
The variable might not be constructed when code is executing at the position the message indicated. The C++ language places these restrictions to prevent the use of unconstructed variables.
585 - syntax error; missing start of function body after constructor initializer
Member initializers can only be used in a constructor's definition. For example:

struct S {
    int a;
    S( int x = 1 ) : a(x)
    {
    }
};
      
586 - conversion ambiguity: [expression] to [type of default argument]
A conversion to an ambiguous base class was detected in the default argument expression.
587 - conversion of expression for default argument is impossible
A conversion to a unrelated class was detected in the default argument expression.
588 - syntax error before template name '%s'
The identifier in the error message has been declared as a template name at this point in the code. This may be the cause of the syntax error.
589 - private base class accessed to convert default argument
A conversion to a private base class was detected in the default argument expression.
590 - protected base class accessed to convert default argument
A conversion to a protected base class was detected in the default argument expression.
591 - operand must be an 'lvalue' (cast produces 'rvalue')
The compiler is expecting a value that can be assigned into. The result of a cast can't be assigned into because a brand new value is always created. Assigning a new value to a temporary is a meaningless operation.
592 - left operand must be an 'lvalue' (cast produces 'rvalue')
The compiler is expecting a value that can be assigned into. The result of a cast can't be assigned into because a brand new value is always created. Assigning a new value to a temporary is a meaningless operation.
593 - right operand must be an 'lvalue' (cast produces 'rvalue')
The compiler is expecting a value that can be assigned into. The result of a cast can't be assigned into because a brand new value is always created. Assigning a new value to a temporary is a meaningless operation.
594 - construct resolved as a declaration/type
The C++ language contains language ambiguities that force compilers to rely on extra information in order to understand certain language constructs. The extra information required to disambiguate the language can be deduced by looking ahead in the source file. Once a single interpretation has been found, the compiler can continue analysing source code. See the Annotated C++ Reference Manual p.93 for more details.

This message warns you that an ambiguous construct has been resolved in a certain direction. In this case, the construct has been determined to be part of a type.

The final resolution varies between compilers, so it's wise to change the source code so that the construct isn't ambiguous. This is especially important in cases where the resolution is more than three tokens away from the start of the ambiguity.
595 - construct resolved as an expression
The C++ language contains language ambiguities that force compilers to rely on extra information in order to understand certain language constructs. The extra information required to disambiguate the language can be deduced by looking ahead in the source file. Once a single interpretation has been found, the compiler can continue analysing source code. See the Annotated C++ Reference Manual p.93 for more details.

This message warns you that an ambiguous construct has been resolved in a certain direction. In this case, the construct has been determined to be part of an expression (a function-like cast).

The final resolution varies between compilers, so it's wise to change the source code so that the construct isn't ambiguous. This is especially important in cases where the resolution is more than three tokens away from the start of the ambiguity.
596 - construct cannot be resolved
The C++ language contains language ambiguities that force compilers to rely on extra information in order to understand certain language constructs. The extra information required to disambiguate the language can be deduced by looking ahead in the source file. Once a single interpretation has been found, the compiler can continue analysing source code. See the Annotated C++ Reference Manual p.93 for more details.

This message warns you that an ambiguous construct couldn't be resolved by the compiler. Please report this to QNX Software Systems Limited so that the problem can be analysed.

597 - encountered another ambiguous construct during disambiguation
The C++ language contains language ambiguities that force compilers to rely on extra information in order to understand certain language constructs. The extra information required to disambiguate the language can be deduced by looking ahead in the source file. Once a single interpretation has been found, the compiler can continue analysing source code. See the Annotated C++ Reference Manual p.93 for more details.

This message warns you that another ambiguous construct was found inside an ambiguous construct. The compiler correctly disambiguates the construct.

You are advised to change code that exhibits this warning because this is definitely uncharted territory in the C++ language.
598 - ellipsis (...) argument contains compiler generated information
A class with virtual functions or virtual bases is being passed to a function that won't know the type of the argument. Since this information can be encoded in a variety of ways, the code might not be portable to another environment. For example:

struct S
{   virtual int foo();
};

static S sv;

extern int bar( S, ... );

static int test = bar( sv, 14, 64 );
      

The call to bar() causes a warning, since the structure S contains information associated with the virtual function for that class.

599 - cannot convert argument for ellipsis (...) argument
This argument can't be used as an ellipsis (...) argument to a function.

Diagnostic messages 600-699

600 - conversion ambiguity: [argument] to [ellipsis (...) argument]
A conversion ambiguity was detected while converting an argument to an ellipsis (...) argument.
601 - converted function type has different #pragma from original function type
Since a #pragma can affect calling conventions, you must be very careful performing casts involving different calling conventions.
602 - class value used as return value or argument in converted function type
The compiler has detected a cast between C and C++ linkage function types. The calling conventions are different because of the different language rules for copying structures.
603 - class value used as return value or argument in original function type
The compiler has detected a cast between C and C++ linkage function types. The calling conventions are different because of the different language rules for copying structures.
604 - must look ahead to determine whether construct is a declaration/type or an expression
The C++ language contains language ambiguities that force compilers to rely on extra information in order to understand certain language constructs. The extra information required to disambiguate the language can be deduced by looking ahead in the source file. Once a single interpretation has been found, the compiler can continue analysing source code. See the Annotated C++ Reference Manual p.93 for more details.

This message warns you that an ambiguous construct has been used.

The final resolution varies between compilers, so it's wise to change the source code so that the construct isn't ambiguous.
605 - assembler error: '%s'
An error has been detected by the #pragma inline assembler.
606 - default argument expression cannot reference 'this'
The order of evaluation for function arguments is unspecified in the C++ language document. Thus, a default argument must be able to be evaluated before the this argument (or any other argument) is evaluated.
607 - #pragma aux must reference a "C" linkage function '%S'
The method of assigning pragma information via the #pragma syntax is provided for compatibility with Watcom C. Because C only allows one function per name, this was adequate for the C language. Since C++ allows functions to be overloaded, a new method of referencing pragmas has been introduced:

#pragma aux this_in_SI parm caller [si] [ax];

struct S {
    void __pragma("this_in_SI") foo( int );
    void __pragma("this_in_SI") foo( char );
};
      
608 - assignment is ambiguous for operands used
An ambiguity was detected while attempting to convert the right operand to the type of the left operand. For example:

struct S1 {
    int a;
};

struct S2 : S1 {
    int b;
};

struct S3 : S2, S1 {
    int c;
};

S1* fn( S3 *p )
{
    return p;
}
      

In the example, class S1 occurs ambiguously for an object or pointer to an object of type S3. A pointer to an S3 object can't be converted to a pointer to an S1 object.

609 - pragma name '%s' is not defined
Pragmas are defined with the #pragma aux syntax. See the chapters 16-bit Pragmas (in the 16-bit Topics supplement) and 32-bit Pragmas for the details of defining a pragma name. If the pragma has been defined, then check the spelling of the pragma name where you've defined it as well as where you've referred to it.
610 - '%S' could not be generated by the compiler
An error occurred while the compiler tried to generate the specified function. The error prevented the compiler from generating the function properly, so the compilation can't continue.
611 - 'catch' does not immediately follow a 'try' or 'catch'
The catch handler syntax must be used in conjunction with a try block, as in the following example:

void f()
{
    try {
    // code that may throw an exception
    } catch( int x ) {
    // handle 'int' exceptions
    } catch( ... ) {
    // handle all other exceptions
    }
}
      
612 - preceding 'catch' specified '...'
Since an ellipsis ... catch handler handles any type of exception, no further catch handlers can exist afterwards because they'll never be executed. Reorder the catch handlers so that the ... catch handler is the last one.
613 - argument to extern "C" function contains compiler generated information
A class with virtual functions or virtual bases is being passed to a function that won't know the type of the argument. Since this information can be encoded in a variety of ways, the code might not be portable to another environment. For example:

struct S
{   virtual int foo();
};

static S sv;

extern "C" int bar( S );

static int test = bar( sv );
      

The call to bar() causes a warning, since the structure S contains information associated with the virtual function for that class.

614 - previous try block defined %L
This informational message indicates where a preceding try block is defined.
615 - previous catch block defined %L
This informational message indicates where a preceding catch block is defined.
616 - 'catch' handler can never be invoked
Because the handlers for a try block are tried in order of appearance, the type specified in a preceding catch can ensure that the current handler will never be invoked. This occurs when:
  • a base class (or reference) precedes a derived class (or reference)
  • a pointer to a base class (or reference to the pointer) precedes a pointer to a derived class (or reference to the pointer)
  • void* or void*& precedes a pointer or a reference to the pointer.

For example:

struct BASE {};
struct DERIVED : public BASE {};

foo()
{
    try {
    // code for try
    } catch( BASE b ) {     // [1]
    // code
    } catch( DERIVED ) {    // error: [1]
    // code
    } catch( BASE* pb ) {   // [2]
    // code
    } catch( DERIVED* pd ) {// error: [2]
    // code
    } catch( void* pv ) {   // [3]
    // code
    } catch( int* pi ) {    // error: [3]
    // code
    } catch( BASE& br ) {   // error: [1]
    // code
    } catch( float*& pfr ) {// error: [3]
    // code
    }
}
      

Each erroneous catch specification indicates the preceding catch block that caused the error.

617 - cannot overload extern "C" functions (the other function is '%S')
The C++ language only allows you to overload functions that are strictly C++ functions. The compiler will automatically generate the correct code to distinguish each particular function based on its argument types. The extern "C" linkage mechanism only allows you to define one C function of a particular name because the C language doesn't support function overloading.
618 - function will be overload ambiguous with '%S' using default arguments
The declaration declares a function that is indistinguishable from another function of the same name with default arguments. For example:

void fn( int, int = 1 );
void fn( int );
      

Calling the function fn() with one argument is ambiguous because it could match either the first fn() with a default argument applied, or the second fn() without any default arguments.

619 - linkage specification is different than previous declaration '%S'
The linkage specification affects the binding of names throughout a program. It's important to maintain consistency because subtle problems could arise when the incorrect function is called. Usually this error prevents an unresolved symbol error during linking because the name of a declaration is affected by its linkage specification. For example:

extern "C" void fn( void );
void fn( void )
{
}
      
620 - not enough segment registers available to generate '%s'
Through a combination of options, the number of available segment registers is too small. This can occur when too many segment registers are pegged. This can be fixed by changing the command-line options to peg only the segment registers that must absolutely be pegged.
621 - pure virtual destructors must have a definition
This is an anomaly for pure virtual functions. A destructor is the only special function that's inherited and allowed to be virtual. A derived class must be able to call the base class destructor so a pure virtual destructor must be defined in a C++ program.
622 - jump into try block
Jumps can't enter try blocks. For example:

foo( int a )
{
if(a) goto tr_lab;
    
    try {
tr_lab:
    throw 1234;
    } catch( int ) {
    if(a) goto tr_lab;
    }

    if(a) goto tr_lab;
}
      

All the preceding goto statements are illegal. The error is detected at the label for forward jumps and at the goto for backward jumps.

623 - jump into catch handler
Jumps can't enter catch handlers. For example:

foo( int a )
{
    if(a)goto ca_lab;

    try {
    if(a)goto ca_lab;
    } catch( int ) {
ca_lab:
    }

    if(a)goto ca_lab;
}
      

All the preceding goto statements are illegal. The error is detected at the label for forward jumps and at the goto for backward jumps.

624 - catch block does not immediately follow try block
At least one catch handler must immediately follow the } of a try block. For example:

extern void goop();
void foo()
{
    try {
    goop();
    }    // a catch block should follow!
}
      

In the example, there were no catch blocks after the try block.

625 - exceptions must be enabled to use feature (use -xs switch)
Exceptions are enabled by specifying the xs switch when the compiler is invoked. The error message indicates that a feature such as try, catch, throw, or function exception specification has been used without enabling exceptions.
626 - I/O error reading '%s': %s"
When attempting to read data from a source or header file, the indicated system error occurred. Likely there's a hardware problem, or the file system has become corrupt.
627 - text following pre-processor directive
A #else or #endif directive was found that had tokens following it, rather than an end of line. Some UNIX style preprocessors allowed this, but it isn't legal under standard C or C++. Make the tokens into a comment.
628 - expression is not meaningful

This message indicates that the indicated expression isn't meaningful. An expression is meaningful when a function is invoked, when an assignment or initialization is performed, or when the expression is cast to void. For example:

void foo( int i, int j )
{
    i + j;  // not meaningful
}
      
629 - expression has no side effect
The indicated expression doesn't cause a side effect. A side effect is caused by invoking a function, by an assignment or an initialization, or by reading a volatile variable. For example:

int k;
void foo( int i, int j )
{
    i + j,  // no side effect (note comma)
    k = 3;
}
      
630 - source conversion type is "%T"
This informational message indicates the type of the source operand, for the preceding conversion diagnostic.
631 - target conversion type is "%T"
This informational message indicates the target type of the conversion, for the preceding conversion diagnostic.
632 - redeclaration of '%S' has different attributes
A function can't be made virtual or pure virtual in a subsequent declaration. All properties of a function should be described in the first declaration of a function. This is especially important for member functions because the properties of a class are affected by its member functions. For example:

struct S {
    void fun();
};

virtual void S::fun()
{
}
      
633 - template class instantiation for '%T' was %L
This informational message indicates that the error or warning was detected during the instantiation of a class template. The final type of the template class is shown as well as the location in the source where the instantiation was initiated.
634 - template function instantiation for '%S' was %L
This informational message indicates that the error or warning was detected during the instantiation of a function template. The final type of the template function is shown as well as the location in the source where the instantiation was initiated.
635 - template class member instantiation was %L
This informational message indicates that the error or warning was detected during the instantiation of a member of a class template. The location in the source where the instantiation was initiated is shown.
636 - function template binding for '%S' was %L
This informational message indicates that the error or warning was detected during the binding process of a function template. The binding process occurs at the point where arguments are analysed in order to infer what types should be used in a function template instantiation. The function template in question is shown along with the location in the source code that initiated the binding process.
637 - function template binding of '%S' was %L
This informational message indicates that the error or warning was detected during the binding process of a function template. The binding process occurs at the point where a function prototype is analysed in order to see if the prototype matches any function template of the same name. The function template in question is shown along with the location in the source code that initiated the binding process.
638 - '%s' defined %L
This informational message indicates where the class in question was defined. The message is displayed following an error or warning diagnostic for the class in question. For example:

class S;
int foo( S*p )
{
    return p->x;
}
      

The variable p is a pointer to an undefined class, and so causes an error to be generated. Following the error, the informational message indicates the line at which the class S was declared.

639 - form is '#pragma template_depth level' where 'level' is a non-zero number
This pragma sets the number of times templates are instantiated for nested instantiations. The depth check prevents infinite compile times for incorrect programs.

For more information about this pragma, see the ``TEMPLATE_DEPTH pragma'' in the following chapters:

640 - possible non-terminating template instantiation (use '#pragma template_depth %d' to increase depth)
This message indicates that a large number of expansions were required to complete a template class or template function instantiation. This may indicate that there's an erroneous use of a template. If the program will complete given more depth, try using the #pragma template_depth suggested in the error message to increase the depth. The number provided is double the previous value.

For more information about this pragma, see the ``TEMPLATE_DEPTH pragma'' in the following chapters:

641 - cannot inherit a partially defined base class '%T'
This message indicates that the base class was in the midst of being defined when it was inherited. The storage requirements for a class type must be known when inheritance is involved because the layout of the final class depends on knowing the complete contents of all base classes. For example:

struct Partial {
    struct Nested : Partial {
    int n;
    };
};
      
642 - ambiguous function: %F defined %L
This informational message shows the functions that were detected to be ambiguous. For example:

int amb( char );       // ambiguous
int amb( unsigned char );  // ambiguous
int amb( char, char );
int k = amb( 14 );
      

The constant value 14 has an int type, and so the attempt to invoke the function amb is ambiguous. The first two functions are ambiguous (and will be displayed); the third isn't considered (nor displayed), since it's declared to have a different number of arguments.

643 - cannot convert argument %d defined %L
This informational message indicates the first argument that couldn't be converted to the corresponding type for the declared function. It's displayed when there's exactly one function declared with the indicated name.
644 - 'this' cannot be converted
This informational message indicates the this pointer for the function that couldn't be converted to the type of the this pointer for the declared function. It's displayed when there's exactly one function declared with the indicated name.
645 - rejected function: %F defined %L
This informational message shows the overloaded functions that were rejected from consideration during function-overload resolution. These functions are displayed when there's more than one function with the indicated name.
646 - '%T' operator can be used
Following a diagnosis of operator ambiguity, this information message indicates that the operator can be applied with operands of the type indicated in the message. For example:

struct S {
    S( int );
    operator int();
    S operator+( int );
};
S s(15);
int k = s + 123;    // "+" is ambiguous
      

In the example, the + operation is ambiguous because it can be implemented by the addition of two integers (with S::operator int applied to the second operand) or by a call to S::operator+. This informational message indicates that the first is possible.

647 - cannot #undef '%s'
The predefined macros __cplusplus, __DATE__, __FILE__, __LINE__, __STDC__, and __TIME__ can't be undefined using the #undef directive. For example:

#undef __cplusplus
#undef __DATE__
#undef __FILE__
#undef __LINE__
#undef __STDC__
#undef __TIME__
      

None of the preceding directives is permitted.

648 - cannot #define '%s'
The predefined macros __cplusplus, __DATE__, __FILE__, __LINE__, __STDC__, and __TIME__ can't be defined using the #define directive. For example:

#define __cplusplus 1
#define __DATE__    2
#define __FILE__    3
#define __LINE__    4
#define __STDC__    5
#define __TIME__    6
      

None of the preceding directives is permitted.

649 - template function '%F' defined %L
This informational message indicates where the function template in question was defined. The message is displayed following an error or warning diagnostic for the function template in question. For example:

template <class T>
    void foo( T, T * )
    {
    }

void bar()
{
    foo(1);    // could not instantiate
}
      

The function template for foo() can't be instantiated for a single argument, causing an error to be generated. Following the error, the informational message indicates the line at which foo() was declared.

650 - ambiguous function template: %F defined %L
This informational message shows the function templates that were detected as ambiguous for the arguments at the call point.
651 - cannot instantiate %S
This message indicates that the function template couldn't be instantiated for the arguments supplied. It's displayed when there's exactly one function template declared with the indicated name.
652 - rejected function template: %F defined %L
This informational message shows the overloaded function template that was rejected from consideration during function-overload resolution. These functions are displayed when there's more than one function or function template with the indicated name.
653 - operand cannot be a function
The indicated operation can't be applied to a function. For example:

int Fun();
int j = ++Fun;    // illegal
      

In the example, the attempt to increment a function is illegal.

654 - left operand cannot be a function
The indicated operation can't be applied to the left operand, which is a function. For example:

extern int Fun();
void foo()
{
    Fun = 0;    // illegal
}
      

In the example, the attempt to assign zero to a function is illegal.

655 - right operand cannot be a function
The indicated operation can't be applied to the right operand, which is a function. For example:

extern int Fun();
void foo()
{
    void* p = 3[Fun];    // illegal
}
      

In the example, the attempt to subscript a function is illegal.

656 - define this function inside its class definition (may improve code quality)
The Watcom C++ compiler has found a constructor or destructor with an empty function body. An empty function body can usually provide optimization opportunities, so the compiler is indicating that by defining the function inside its class definition, the compiler may be able to perform some important optimizations. For example:

struct S {
    ~S();
};

S::~S() {
}
      
657 - define this function inside its class definition (could have improved code quality)
The Watcom C++ compiler has found a constructor or destructor with an empty function body. An empty function body can usually provide optimization opportunities, so the compiler is indicating that by defining the function inside its class definition, the compiler may be able to perform some important optimizations. This particular warning indicates that the compiler has already found an opportunity in previous code but it found out too late that the constructor or destructor had an empty function body. For example:

struct S {
    ~S();
};
struct T : S {
    ~T() {}
};

S::~S() {
}
      
658 - cannot convert address of overloaded function '%S'
This information message indicates that an address of an overloaded function can't be converted to the indicated type. For example:

int ovload( char );
int ovload( float );
int routine( int (*)( int );
int k = routine( ovload );
      

The first argument for the function routine can't be converted, resulting in the informational message.

659 - expression cannot have 'void' type
The indicated expression can't have a void type. For example:

main( int argc, char* argv )
{
    if( (void)argc ) {
      return 5;
    } else {
      return 9;
    }
}
      

Conditional expressions, such as the one illustrated in the if statement can't have a void type.

660 - cannot reference a bit field
The smallest addressable unit is a byte. You can't reference a bit field. For example:

struct S
{   int bits :6;
    int bitfield :10;
};
S var;
int& ref = var.bitfield;    // illegal
      
661 - cannot assign to object having an undefined class
An assignment can't be be made to an object whose class hasn't been defined. For example:

class X;    // declared, but not defined
extern X& foo();    // returns reference (ok)
extern X obj;
void goop()
{
    obj = foo();    // error
}
      
662 - cannot create member pointer to constructor
A member pointer value can't reference a constructor. For example:

class C {
    C();
};
int foo()
{
    return 0 == &C::C;
}
      
663 - cannot create member pointer to destructor
A member pointer value can't reference a destructor. For example:

class C {
    ~C();
};
int foo()
{
    return 0 == &C::~C;
}
      
664 - attempt to initialize a non-constant reference with a temporary object
A temporary value can't be converted to a non-constant reference type. For example:

struct C {
    C( C& );
    C( int );
};

C & c1 = 1;
C c2 = 2;
      

The initializations of c1 and c2 are erroneous, since temporaries are being bound to non-const references:

  • In the case of c1, an implicit constructor call is required to convert the integer to the correct object type. This results in the creation of a temporary object to initialize the reference. Subsequent code can modify this temporary's state.
  • The initialization of c2, is erroneous for a similar reason. In this case, the temporary is being bound to the non-const reference argument of the copy constructor.
665 - temporary object used to initialize a non-constant reference
Ordinarily, a temporary value can't be bound to a non-constant reference. There's enough legacy code present that the Watcom C++ compiler issues a warning in cases that should be errors. This may change in the future, so it's advisable to correct the code as soon as possible.
666 - assuming unary 'operator &' not overloaded for type '%T'
An explicit address operator can be applied to a reference to an undefined class. The Watcom C++ compiler assumes that the address is required but it doesn't know whether this was your intention because the class definition hasn't been seen. For example:

struct S;

S * fn( S &y ) {
    // assuming no operator '&' defined
    return &y;
}
      
667 - 'va_start' macro will not work without an argument before ...
The warning indicates that it's impossible to access the arguments passed to the function without declaring an argument before the ... argument. The ... style of argument list (without any other arguments) is only useful as a prototype, or if the function is designed to ignore all of its arguments. For example:

void fn( ... )
{
}
      
668 - 'va_start' macro will not work with a reference argument before "..."
The warning indicates that taking the address of the argument before the ... argument, which va_start does in order to access the variable list of arguments, won't give the expected result. The arguments have to be rearranged so that an acceptable argument is declared before the ... argument, or a dummy int argument can be inserted after the reference argument with the corresponding adjustments made to the callers of the function. For example:

#include <stdarg.h>

void fn( int &r, ... )
{
    va_list args;

    // address of 'r' is address of
    // object 'r' references so
    // 'va_start' won't work properly
    va_start( args, r );
    va_end( args );
}
      
669 - 'va_start' macro will not work with a class argument before "..."
This warning is specific to C++ compilers that quietly convert class arguments to class reference arguments. The warning indicates that taking the address of the argument before the ... argument, which va_start() does in order to access the variable list of arguments, won't give the expected result. The arguments have to be rearranged so that an acceptable argument is declared before the ... argument, or a dummy int argument can be inserted after the class argument with the corresponding adjustments made to the callers of the function. For example:

#include <stdarg.h>

struct S {
    S();
};

void fn( S c, ... )
{
    va_list args;

    // Watcom C++ passes a pointer to
    // the temporary created for passing
    // 'c' rather than pushing 'c' on the
    // stack so 'va_start' won't work
    // properly
    va_start( args, c );
    va_end( args );
}
      
670 - function modifier conflicts with previous declaration '%S'
The symbol declaration conflicts with a previous declaration with regard to function modifiers. Either the previous declaration didn't have a function modifier, or it had a different one. For example:

#pragma aux never_returns aborts;

void fn( int, int );
void __pragma("never_returns") fn( int, int );
      
671 - function modifier cannot be used on a variable
The symbol declaration has a function modifier that is applied to a variable or non-function. The cause of this may be a declaration with a missing function argument list. For example:

int (* __pascal ok)();
int (* __pascal not_ok);
      
672 - '%T' contains the following pure virtual functions
This informational message indicates that the class contains pure virtual function declarations. The class is definitely abstract as a result and can't be used to declare variables. The pure virtual functions declared in the class are displayed immediately following this message. For example:

struct A {
    void virtual fn( int ) = 0;
};

A x;
      
673 - '%T' has no implementation for the following pure virtual functions
This informational message indicates that the class is derived from an abstract class but the class didn't override enough virtual function declarations. The pure virtual functions declared in the class are displayed immediately following this message. For example:

struct A {
    void virtual fn( int ) = 0;
};
struct D : A {
};

D x;
      
674 - '%F' defined %L
This informational message indicates that the pure virtual function hasn't been overridden. This means that the class is abstract. For example:

struct A {
    void virtual fn( int ) = 0;
};
struct D : A {
};

D x;
      
675 - restriction: standard calling convention required for '%S'
The indicated function may be called by the C++ runtime system using the standard calling convention. The calling convention specified for the function is incompatible with the standard convention. This message may result when __pascal is specified for a default constructor, a copy constructor, or a destructor. It may also result when parm reverse is specified in a #pragma for the function.
676 - number of arguments in function call is incorrect
The number of arguments in the function call doesn't match the number declared for the function type. For example:

extern int (*pfn)( int, int );
int k = pfn( 1, 2, 3 );
      

In the example, the function pointer was declared to have two arguments. Three arguments were used in the call.

677 - function has type '%T'
This informational message indicates the type of the function being called.
678 - invalid octal constant
The constant started with a 0 digit, which makes it look like an octal constant, but the constant contained the digits 8 and 9. The problem could be an incorrect octal constant or a missing . for a floating constant. For example:

int i = 0123456789;    // invalid octal constant
double d = 0123456789;    // missing '.'?
      
679 - class template definition started %L
This informational message indicates where the class template definition started, so that any problems with missing braces can be fixed quickly and easily. For example:

template <class T>
    struct S {
    void f1() {
    // error missing '}'
    };

template <class T>
    struct X {
    void f2() {
    }
    };
      
680 - constructor initializer started %L
This informational message indicates where the constructor initializer started, so that any problems with missing parentheses can be fixed quickly and easily. For example:

struct S {
    S( int x ) : a(x), b(x // missing parenthesis
    {
    }
};
      
681 - zero size array must be the last data member
The language extension that allows a zero-size array to be declared in a class definition requires that the array be the last data member in the class. For example:

struct S {
    char a[ ];
    int b;
};
      
682 - cannot inherit a class that contains a zero size array
The language extension that allows a zero-size array to be declared in a class definition disallows the use of the class as a base class. This prevents you from corrupting storage in derived classes through the use of the zero-size array. For example:

struct B {
    int b;
    char a[ ];
};
struct D : B {
    int d;
};
      
683 - zero size array '%S' cannot be used in a class with base classes
The language extension that allows a zero-size array to be declared in a class definition requires that the class not have any base classes. This is required because the C++ compiler must be free to organize base classes in any manner for optimization purposes. For example:

struct B {
    int b;
};
struct D : B {
    int d;
    char a[ ];
};
      
684 - cannot catch abstract class object
C++ doesn't allow abstract classes to be instantiated, and so an abstract class object can't be specified in a catch clause. It's permissible to catch a reference to an abstract class. For example:

class Abstract {
public:
    virtual int foo() = 0;
};

class Derived : Abstract {
public:
    int foo();
};

int xyz;

void func( void ) {
    try {
    throw Derived();
    } catch( Abstract abstract ) {   // object
    xyz = 1;
    }
}
      
The catch clause in the preceding example would be diagnosed as improper, since an abstract class is specified. The example could be coded as follows:

class Abstract {
public:
    virtual int foo() = 0;
};

class Derived : Abstract {
public:
    int foo();
};

int xyz;

void func( void ) {
    try {
    throw Derived();
    } catch( Abstract & abstract ) {  // reference
    xyz = 1;
    }
}
      
685 - non-static member function '%S' cannot be specified
The indicated non-static member function can't be used in this context. For example, such a function can't be used as the second or third operand of the conditional operator. For example:

struct S {
    int foo();
    int bar();
    int fun();
};

int S::fun( int i ) {
    return (i ? foo : bar)();
}
      

Neither foo nor bar can be specified as shown in the example. The example can be properly coded as follows:

struct S {
    int foo();
    int bar();
    int fun();
};

int S::fun( int i ) {
    return i ? foo() : bar();
}
      
686 - attempt to convert pointer or reference from a base to a derived class
A pointer or reference to a base class can't be converted to a pointer or reference, respectively, of a derived class, unless there's an explicit cast. The return statements in the following example are diagnosed:

struct Base {};
struct Derived : Base {};

Base b;

Derived* ReturnPtr() { return &b; }
Derived& ReturnRef() { return b; }
      

The following program would be acceptable:

struct Base {};
struct Derived : Base {};

Base b;

Derived* ReturnPtr() { return (Derived*)&b; }
Derived& ReturnRef() { return (Derived&)b; }
      
687 - expression for 'while' is always true
The compiler has detected that the expression is always true. Consequently, the loop will execute infinitely unless there's a break statement within the loop or a throw statement is executed while executing within the loop. If such an infinite loop is required, it can be coded as for( ; ; ) without causing warnings.
688 - testing expression for 'for' is always true
The compiler has detected that the expression is always true. Consequently, the loop will execute infinitely unless there's a break statement within the loop or a throw statement is executed while executing within the loop. If such an infinite loop is required, it can be coded as for( ; ; ) without causing warnings.
689 - conditional expression is always true (non-zero)
The indicated expression is a non-zero constant, and so is always true.
690 - conditional expression is always false (zero)
The indicated expression is a zero constant, and so is always false.
691 - expecting a member of '%T' to be defined in this context
A class template member definition must define a member of the associated class template. The complexity of the C++ declaration syntax can make this error hard to identify visually. For example:

template <class T>
    struct S {
    typedef int X;
    static X fn( int );
    static X qq;
    };

template <class T>
    S<T>::X fn( int ) {// should be 'S<T>::fn'

    return fn( 2 );
    }

template <class T>
    S<T>::X qq = 1;    // should be 'S<T>::q'

S<int> x;
      
692 - cannot throw an abstract class '%T'
An abstract class can't be thrown, since copies of that object may have to be made (which is impossible ). For example:

struct abstract_class {
    abstract_class( int );
    virtual int foo() = 0;
};

void goop()
{
    throw abstract_class( 17 );
}
      

The throw expression is illegal, since it specifies an abstract class.

693 - cannot create pre-compiled header file '%s'
The compiler has detected a problem while trying to open the pre-compiled header file for write access.
694 - error occurred while writing pre-compiled header file
The compiler has detected a problem while trying to write some data to the pre-compiled header file.
695 - error occurred while reading pre-compiled header file
The compiler has detected a problem while trying to read some data from the pre-compiled header file.
696 - pre-compiled header file cannot be used
The pre-compiled header file may either be corrupted, or a version that the compiler can't use due to updates to the compiler.
697 - pre-compiled header file cannot be used (different compile options)
The compiler has detected that the command-line options have changed enough so that the contents of the pre-compiled header file can't be used.
698 - pre-compiled header file cannot be used (different #include file)
The compiler has detected that the first #include file name is different, so the contents of the pre-compiled header file can't be used.
699 - pre-compiled header file cannot be used (different current directory)
The compiler has detected that the working directory is different, so the contents of the pre-compiled header file can't be used.

Diagnostic messages 700-715

700 - pre-compiled header file cannot be used (different INCLUDE path)
The compiler has detected that the INCLUDE path is different, so the contents of the pre-compiled header file can't be used.
701 - pre-compiled header file cannot be used ('%s' has been modified)
The compiler has detected that an include file has changed, so the contents of the pre-compiled header file can't be used.
702 - pre-compiled header file cannot be used (macro '%s' is different)
The compiler has detected that a macro definition is different, so the contents of the pre-compiled header file can't be used. The macro was referenced during processing of the header file that created the pre-compiled header file, so the contents of the pre-compiled header may be affected.
703 - pre-compiled header file cannot be used (macro '%s' is not defined)
The compiler has detected that a macro hasn't been defined, so the contents of the pre-compiled header file can't be used. The macro was referenced during processing of the header file that created the pre-compiled header file, so the contents of the pre-compiled header may be affected.
704 - command line specifies smart windows callbacks and DS not equal to SS
An illegal combination of switches has been detected. The ``windows smart callbacks'' option can't be combined with either of the ``build DLL'' or ``DS not equal to SS'' options.
705 - class '%N' cannot be used with #pragma dump_object_model
The indicated name hasn't yet been declared, or has been declared but not yet been defined as a class. Consequently, the object model can't be dumped.
706 - repeated modifier is '%s'
This informational message indicates which modifier was repeated in the declaration. For example:

typedef int __far FARINT;
FARINT __far *p;    // repeated __far modifier
      
707 - semicolon (';') may be missing after class/enum definition
This informational message indicates that a missing semicolon (;) may be the cause of the error. For example:

struct S {
int x,y;
S( int, int );
} // missing semicolon ';'

S::S( int x, int y ) : x(x), y(y) {
}
      
708 - cannot return a type of unknown size
A value of an unknown type can't be returned. For example:

class S;
S foo();

int goo()
{
    foo();
}
      

In the example, foo() can't be invoked because the class that it returns hasn't been defined.

709 - cannot initialize array member '%S'
An array class member can't be specified as a constructor initializer. For example:

class S {
public:
    int arr[3];
    S();
};
S::S() : arr( 1, 2, 3 ) {}
      

In the example, arr can't be specified as a constructor initializer. Instead, the array may be initialized within the body of the constructor:

class S {
public:
    int arr[3];
    S();
};
S::S()
{
    arr[0] = 1;
    arr[1] = 2;
    arr[2] = 3;
}
      
710 - file '%s' will #include itself forever
The compiler has detected that the file in the message has been #included from within itself, without protecting against infinite inclusion. This can happen if #ifndef and #define header file protection hasn't been used properly. For example:

#include __FILE__
      
711 - virtual function '%S' cannot have its return type changed
This restriction is due to the relatively new feature in the C++ language that allows return values to be changed when a virtual function has been overridden. It isn't possible to support both features because in order to support changing the return value of a function, the compiler must construct a ``wrapper'' function that calls the virtual function first, then changes the return value, and returns. It isn't possible to do this with ... style functions because the number of parameters isn't known. For example:

struct B {
};
struct D : virtual B {
};

struct X {
    virtual B *fn( int, ... );
};
struct Y : X {
    virtual D *fn( int, ... );
};
      
712 - __declspec( '%N' ) is not supported
The identifier used in the __declspec declaration modifier isn't supported by Watcom C++.
713 - attempt to construct a far object when data model is near
Constructors can't be applied to objects that are stored in far memory when the default memory model for data is near. For example:

struct Obj
{   char *p;
    Obj();
};

Obj far obj;
      

The last line causes this error to be displayed when the memory model is small (switch ms), since the memory model for data is near.

714 - -zo not needed since there is no system-specific exception handling
There was no need to specify the zo switch for the indicated target environment. That environment has no system-specific exception-handling mechanism. System-specific exception handling has been implemented for only 32-bit targets on the OS/2 and NT operating systems.
715 - class modifiers for '%T' conflict with class modifiers for '%T'

A conflict between class modifiers for classes related through inheritance has been detected:

  • The first type of conflict occurs if one base class has no class modifiers and another base class has class modifiers.
  • The second type of conflict occurs if two base classes have class modifiers that are different.

The conflict can be resolved by ensuring that all classes related through inheritance have the same class modifiers. For example:

struct __cdecl B1 {
    virtual void fn( int );
};
struct __pascal B2 {
    virtual void fn( int );
};
struct D : B1, B2 {
    virtual void fn( int );
};