messages.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 2,168 行 · 第 1/5 页

GML
2,168
字号
:MSGJTXT. 儅僋儘'%s'偵梌偊傜傟偨僷儔儊乕僞乕偑晄廫暘偱偡
You have not supplied enough parameters to the specified macro.
:errbad.
#define mac(a,b) a+b
int i = mac(123);   // needs 2 parameters
:eerrbad.

:MSGSYM. ERR_NOT_EXPECTING_RETURN_VALUE
:MSGTXT. not expecting a return value
:MSGJTXT. 栠傝抣偼側偄偼偢偱偡
The specified function is declared as a
.kw void
function.
Delete the
.kw return
value, or change the type of the function.
:errbad.
void fun()
{
    return 14;  // not expecting return value
}
:eerrbad.

:MSGSYM. ERR_CANT_TAKE_ADDR_OF_BIT_FIELD
:MSGTXT. cannot take address of a bit-field
:MSGJTXT. 價僢僩僼傿乕儖僪偺傾僪儗僗傪偲傞偙偲偑偱偒傑偣傫
The smallest addressable unit is a byte.
You cannot take the address of a bit field.
:errbad.
struct S
{   int bits :6;
    int bitfield :10;
};
S var;
void* p = &var.bitfield;    // illegal
:eerrbad.

:MSGSYM. ERR_NOT_A_CONSTANT_EXPR
:MSGTXT. expression must be a constant
:MSGJTXT. 幃偼掕悢偱側偗傟偽側傝傑偣傫
The compiler expects a constant expression.
This message can occur during static initialization if you are
trying to initialize a non-pointer type with an address expression.

:MSGSYM. ERR_CANT_OPEN_FILE
:MSGTXT. unable to open '%s'
:MSGJTXT. '%s'傪僆乕僾儞偡傞偙偲偑偱偒傑偣傫
The file specified in an
.kw #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
.ev &incvarup
or
.ev INCLUDE
environment variables or in the "i=" option on the command line.

:MSGSYM. ANSI_TOO_MANY_MACRO_PARMS
:MSGTXT. too many parameters given for macro '%s'
:MSGJTXT. 儅僋儘'%s'偵梌偊傜傟偨僷儔儊乕僞偑懡偡偓傑偡
:ANSI. 1
You have supplied too many parameters for the specified macro.
The extra parameters are ignored.
:errbad.
#define mac(a,b) a+b
int i = mac(1,2,3); // needs 2 parameters
:eerrbad.

:MSGSYM. ERR_CANNOT_USE_PCPTR
:MSGTXT. cannot use __based or __far16 pointers in this context
:MSGJTXT. 偙偺僐儞僥僉僗僩偵偍偄偰丆__based偁傞偄偼__far16億僀儞僞傪巊偆偙偲偼偱偒傑偣傫
The use of
.kw __based
and
.kw __far16
pointers is prohibited in
.kw throw
expressions and
.kw catch
statements.
:errbad.
extern int __based( __segname( "myseg" ) ) *pi;

void bad()
{
    try {
    throw pi;
    } catch( int __far16 *p16 ) {
    *p16 = 87;
    }
}
:eerrbad.
Both the
.kw throw
expression and
.kw catch
statements cause this error to be diagnosed.

:MSGSYM. ERR_TOO_MANY_TYPES_IN_DSPEC
:MSGTXT. only one type is allowed in declaration specifiers
:MSGJTXT. 堦偮偺宆偩偗偑愰尵巜掕巕偺拞偱嫋偝傟傑偡
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.
:errbad.
class C
{
public:
    C();
}           // needs ";"

int foo() { return 7; }
:eerrbad.

:MSGSYM. ERR_OUT_OF_MEMORY
:MSGTXT. out of memory
:MSGJTXT. 儊儌儕乕晄懌偱偡
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.
Do not
.kw #include
header files that are not required.

:MSGSYM. ERR_INV_CHAR_CONSTANT
:MSGTXT. invalid character constant
:MSGJTXT. 晄揔愗側暥帤掕悢偱偡
This message is issued for an improperly formed character constant.
:errbad.
char c = '12345';
char d = ''';
:eerrbad.

:MSGSYM. WARN_CANT_TAKE_ADDR_OF_REGISTER
:MSGTXT. taking address of variable with storage class 'register'
:MSGJTXT. 婰壇僋儔僗'register'偺曄悢偺傾僪儗僗傪庢偭偰偄傑偡
:WARNING. 2
You can take the address of a
.kw register
variable in C++ (but not in ISO/ANSI C). If there is a chance that the source
will be compiled using a C compiler, change the storage
class from
.kw register
to
.kw auto.
:errgood.
extern int foo( char* );
int bar()
{
    register char c = 'c';
    return foo( &c );
}
:eerrgood.

:MSGSYM. ANSI_NO_DELETE_SIZE_EXPR
:MSGTXT. 'delete' expression size is not allowed
:MSGJTXT. 'delete'幃偺戝偒偝偺巜掕偼嫋偝傟傑偣傫
:ANSI. 1
The C++ language has evolved to the point where the
.kw delete
expression size is no longer required for a correct deletion of an
array.
:errbad.
void fn( unsigned n, char *p ) {
    delete [n] p;
}
:eerrbad.

:MSGSYM. ERR_MISSING_QUOTE
:MSGTXT. ending " missing for string literal
:MSGJTXT. 暥帤楍掕悢偵懳偡傞廔椆偺"偑偁傝傑偣傫
The compiler did not find a second double quote to end the string literal.
:errbad.
char *a = "no_ending_quote;
:eerrbad.

:MSGSYM. ERR_INVALID_OPTION
:MSGTXT. invalid option
:MSGJTXT. 晄揔愗側僆僾僔儑儞偱偡
The specified option is not recognized by the compiler.

:MSGSYM. ERR_INVALID_OPTIMIZATION
:MSGTXT. invalid optimization option
:MSGJTXT. 晄揔愗側嵟揔壔僆僾僔儑儞偱偡
The specified option is an unrecognized optimization option.

:MSGSYM. ERR_INVALID_MEMORY_MODEL
:MSGTXT. invalid memory model
:MSGJTXT. 晄揔愗側儊儌儕儌僨儖偱偡
Memory model option must be one of "ms", "mm", "mc", "ml", "mh" or
"mf" which selects the Small, Medium, Compact, Large, Huge or Flat
memory model.

:MSGSYM. ERR_EXPR_MUST_BE_INTEGRAL
:MSGTXT. expression must be integral
:MSGJTXT. 幃偼惍悢偱側偗傟偽側傝傑偣傫
An integral expression is required.
:errbad.
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;
    }
}
:eerrbad.

:MSGSYM. ERR_EXPR_MUST_BE_ARITHMETIC
:MSGTXT. expression must be arithmetic
:MSGJTXT. 幃偼嶼弍幃偱側偗傟偽側傝傑偣傫
Arithmetic operations, such as "/" and "*",  require arithmetic operands
unless the operation has been overloaded
or unless the operands can be converted to arithmetic operands.
:errbad.
class C
{
public:
    int c;
};
C cv;
int i = cv / 2;
:eerrbad.

:MSGSYM. ERR_STMT_REQUIRED_AFTER_LABEL
:MSGTXT. statement required after label
:MSGJTXT. 儔儀儖偺屻偵暥偑昁梫偱偡
The C language definition requires a statement following a label.
You can use a null statement which consists of just a semicolon (";").
:errbad.
extern int bar( int );
void foo( int a )
{
    if( a ) goto ending;
    bar( a );
ending:
    // needs statement following
}
:eerrbad.

:MSGSYM. ERR_STMT_REQUIRED_AFTER_DO
:MSGTXT. statement required after 'do'
:MSGJTXT. 'do'偺屻偵暥偑昁梫偱偡
A statement is required between the
.kw do
and
.kw while
keywords.

:MSGSYM. ERR_STMT_REQUIRED_AFTER_CASE
:MSGTXT. statement required after 'case'
:MSGJTXT. 'case'偺屻偵暥偑昁梫偱偡
The C language definition requires a statement following a
.kw case
label.
You can use a null statement which consists of just a semicolon (";").
:errbad.
int foo( int a )
{
    switch( a ) {
      default:
    return 7;
      case 1: // needs statement following
    }
    return 18;
}
:eerrbad.

:MSGSYM. ERR_STMT_REQUIRED_AFTER_DEFAULT
:MSGTXT. statement required after 'default'
:MSGJTXT. 'default'偺屻偵暥偑昁梫偱偡
The C language definition requires a statement following a
.kw default
label.
You can use a null statement which consists of just a semicolon (";").
:errbad.
int foo( int a )
{
    switch( a ) {
      case 7:
    return 7;
      default:
    // needs statement following
    }
    return 18;
}
:eerrbad.

:MSGSYM. ERR_MISSING_CENDIF
:MSGTXT. missing matching #endif directive
:MSGJTXT. 懳墳偡傞#endif媅帡柦椷偑偁傝傑偣傫
You are missing a
.kw #endif
to terminate a
.kw #if,
.kw #ifdef
or
.kw #ifndef
preprocessing directive.
:errbad.
#if 1
int a;
// needs #endif
:eerrbad.

:MSGSYM. ERR_INVALID_MACRO_DEFN
:MSGTXT. invalid macro definition, missing ')'
:MSGJTXT. 晄揔愗側儅僋儘掕媊偱偡丟 乯偑偁傝傑偣傫
The right parenthesis ")" is required for a function-like macro definition.
:errbad.
#define bad_mac( a, b
:eerrbad.

:MSGSYM. ERR_INCOMPLETE_MACRO
:MSGTXT. missing ')' for expansion of '%s' macro
:MSGJTXT. '%s'儅僋儘偺揥奐偵懳偟偰乯偑偁傝傑偣傫
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.
:errbad.
#define mac( a, b) a+b
int d = mac( 1, 2
:eerrbad.

:MSGSYM. ERR_USER_ERROR_MSG
:MSGTXT. %s
:MSGJTXT. %s
This is a user message generated with the
.kw #error
preprocessing directive.
:errbad.
#error my very own error message
:eerrbad.

:MSGSYM. ERR_CANT_HAVE_AN_ARRAY_OF_FUNCTIONS
:MSGTXT. cannot define an array of functions
:MSGJTXT. 娭悢偺攝楍傪掕媊偡傞偙偲偼偱偒傑偣傫
You can have an array of pointers to functions, but not an array
of functions.
:errbad.
typedef int TD(float);
TD array[12];
:eerrbad.

:MSGSYM. ERR_FUNCTION_CANT_RETURN_AN_ARRAY
:MSGTXT. function cannot return an array
:MSGJTXT. 娭悢偼攝楍傪栠偡偙偲偑偱偒傑偣傫
A function cannot return an array.
You can return a pointer to an array.
:errbad.
typedef int ARR[10];
ARR fun( float );
:eerrbad.

:MSGSYM. ERR_FUNCTION_CANT_RETURN_A_FUNCTION
:MSGTXT. function cannot return a function
:MSGJTXT. 娭悢偼娭悢傪栠偡偙偲偑偱偒傑偣傫
You cannot return a function.
You can return a pointer to a function.
:errbad.
typedef int TD();
TD fun( float );
:eerrbad.

:MSGSYM. ERR_FUNCTION_TEMPLATE_ONLY_GENERICS
:MSGTXT. function templates can only have type arguments
:MSGJTXT. 娭悢僥儞僾儗乕僩偼宆堷悢傪帩偮偙偲偑偱偒傞偩偗偱偡
A function template argument can only be a generic type (e.g.,
.id template < class
T
.id >
).
This is a restriction in the C++ language that allows compilers to
automatically instantiate functions purely from the argument types of calls.

:MSGSYM. ERR_MAX_STRUCT_EXCEEDED
:MSGTXT. maximum class size has been exceeded
:MSGJTXT. 僋儔僗僒僀僘偑嵟戝抣傪墇偊傑偟偨
The 16-bit compiler limits the size of a
.kw struct
or
.kw 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
.kw unsigned
integer.
:errbad.
struct S
{
    char arr1[ 0xfffe ];
    char arr2[ 0xfffe ];
    char arr3[ 0xfffe ];
    char arr4[ 0xfffffffe ];
};
:eerrbad.

:MSGSYM. ANSI_MACRO_DEFN_NOT_IDENTICAL
:MSGTXT. definition of macro '%s' not identical to previous definition
:MSGJTXT. 儅僋儘'%s'偺掕媊偑埲慜偺掕媊偲堦抳偟傑偣傫
:ANSI. 1
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
.kw #undef
it before you can define it with a new definition.
:errbad.
#define CON 123
#define CON 124     // not same as previous
:eerrbad.

:MSGSYM. ERR_CANNOT_INIT_IN_NON_FILE_SCOPE
:MSGTXT. initialization of '%S' must be in file scope
:MSGJTXT. '%S'偺弶婜壔愝掕偼僼傽僀儖丒僗僐乕僾偺拞偵側偗傟偽側傝傑偣傫
A file scope variable must be initialized in file scope.
:errbad.
void fn()
{
    extern int v = 1;
}
:eerrbad.

:MSGSYM. WARN_DEFAULT_ARG_ADDED_TO_MEMBER_FN
:MSGTXT. default argument for '%S' declared outside of class definition
:MSGJTXT. '%S'偺僨僼僅儖僩堷悢偑僋儔僗掕媊偺奜晹偱愰尵偝傟傑偟偨
:WARNING. 1
Problems can occur with member functions that do not declare all of their
default arguments during the class definition.  For instance, a copy

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?