messages.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 2,168 行 · 第 1/5 页
GML
2,168 行
preprocessing group and before the
.kw #else
directive if present.
:errbad.
int a;
#else
int c;
#elif IN_IF
int b;
#endif
:eerrbad.
The
.kw #else,
.kw #elif,
and
.kw #endif
statements are all illegal because there is no
.kw #if
that corresponds to them.
:MSGSYM. ERR_MISPLACED_ELSE
:MSGTXT. misplaced #else directive
:MSGJTXT. #else媅帡柦椷偺埵抲偑娫堘偭偰偄傑偡
The
.kw #else
directive must be inside an
.kw #if
preprocessing group and follow all
.kw #elif
directives if present.
:errbad.
int a;
#else
int c;
#elif IN_IF
int b;
#endif
:eerrbad.
The
.kw #else,
.kw #elif,
and
.kw #endif
statements are all illegal because there is no
.kw #if
that corresponds to them.
:MSGSYM. ERR_MISPLACED_ENDIF
:MSGTXT. misplaced #endif directive
:MSGJTXT. #endif媅帡柦椷偺埵抲偑娫堘偭偰偄傑偡
A
.kw #endif
preprocessing directive has been found without a matching
.kw #if
directive.
You either have an extra
.kw #endif
or you are missing an
.kw #if
directive earlier in the file.
:errbad.
int a;
#else
int c;
#elif IN_IF
int b;
#endif
:eerrbad.
The
.kw #else,
.kw #elif,
and
.kw #endif
statements are all illegal because there is no
.kw #if
that corresponds to them.
:MSGSYM. ERR_ONLY_1_DEFAULT
:MSGTXT. only one 'default' per switch statement is allowed
:MSGJTXT. 1偮偺switch暥偵嫋偝傟傞'default'偼1偮偩偗偱偡
You cannot have more than one
.kw default
label in a
.kw switch
statement.
:errbad.
int translate( int a )
{
switch( a ) {
case 1:
a = 8;
break;
default:
a = 9;
break;
default: // illegal
a = 10;
break;
}
return a;
}
:eerrbad.
:MSGSYM. ERR_EXPECTING_BUT_FOUND
:MSGTXT. expecting '%s' but found '%s'
:MSGJTXT. '%s'偑偁傞偼偢偱偡偑丆'%s'偑偁傝傑偟偨
A syntax error has been detected.
The tokens displayed in the message should help you to determine the problem.
:MSGSYM. ERR_UNDECLARED_SYM
:MSGTXT. symbol '%N' has not been declared
:MSGJTXT. 僔儞儃儖'%N'偼愰尵偝傟傑偣傫偱偟偨
The compiler has found a symbol which has not been previously declared.
The symbol may be spelled differently than the declaration, or you may
need to
.kw #include
a header file that contains the declaration.
:errbad.
int a = b; // b has not been declared
:eerrbad.
:MSGSYM. ERR_NOT_A_FUNCTION
:MSGTXT. left expression must be a function or a function pointer
:MSGJTXT. 嵍曈偼娭悢偐娭悢億僀儞僞偱側偗傟偽側傝傑偣傫
The compiler has found an expression that looks like a function call,
but it is not defined as a function.
:errbad.
int a;
int b = a( 12 );
:eerrbad.
:MSGSYM. ERR_MUST_BE_LVALUE
:MSGTXT. operand must be an lvalue
:MSGJTXT. 僆儁儔儞僪偼'嵍曈抣'偱側偗傟偽側傝傑偣傫
The operand on the left side of an "=" sign must be a variable or
memory location which can have a value assigned to it.
:errbad.
void foo( int a )
{
( a + 1 ) = 7;
int b = ++ ( a + 6 );
}
:eerrbad.
Both statements within the function are erroneous, since lvalues are
expected where the additions are shown.
:MSGSYM. ERR_LABEL_ALREADY_DEFINED
:MSGTXT. label '%s' already defined
:MSGJTXT. 儔儀儖'%s'偼偡偱偵掕媊偝傟偰偄傑偡
All labels within a function must be unique.
:errbad.
void bar( int *p )
{
label:
*p = 0;
label:
return;
}
:eerrbad.
The second label is illegal.
:MSGSYM. ERR_UNDEFINED_LABEL
:MSGTXT. label '%s' is not defined in function
:MSGJTXT. 儔儀儖'%s'偼娭悢偺拞偱掕媊偝傟偰偄傑偣傫
A
.kw goto
statement has referenced a label that is not defined in the function.
Add the necessary label or check the spelling of the label(s) in the
function.
:errbad.
void bar( int *p )
{
labl:
*p = 0;
goto label;
}
:eerrbad.
The label referenced in the
.kw goto
is not defined.
:MSGSYM. ERR_ZERO_DIMENSION
:MSGTXT. dimension cannot be zero
:MSGJTXT. 師尦偼僛儘偱偁傞偙偲偑偱偒傑偣傫
The dimension of an array must be non-zero.
:errbad.
int array[0]; // not allowed
:eerrbad.
:MSGSYM. ERR_NEGATIVE_DIMENSION
:MSGTXT. dimension cannot be negative
:MSGJTXT. 師尦偼晧偺悢偱偁傞偙偲偑偱偒傑偣傫
The dimension of an array must be positive.
:errbad.
int array[-1]; // not allowed
:eerrbad.
:MSGSYM. ERR_DIMENSION_REQUIRED
:MSGTXT. dimensions of multi-dimension array must be specified
:MSGJTXT. 懡師尦攝楍偺師尦偼巜掕偝傟側偗傟偽側傝傑偣傫
All dimensions of a multiple dimension array must be specified.
The only exception is the first dimension which can declared as "[]".
:errbad.
int array[][]; // not allowed
:eerrbad.
:MSGSYM. ERR_INVALID_STG_CLASS_FOR_FUNC
:MSGTXT. invalid storage class for function
:MSGJTXT. 娭悢偵懳偟偰晄揔愗側婰壇僋儔僗偱偡
If a storage class is given for a function, it must be
.kw static
or
.kw extern.
:errbad.
auto void foo()
{
}
:eerrbad.
:MSGSYM. ERR_EXPR_MUST_BE_POINTER_TO
:MSGTXT. expression must have pointer type
:MSGJTXT. 幃偼'...傊偺億僀儞僞'偱側偗傟偽側傝傑偣傫
An attempt has been made to de-reference a variable or expression
which is not declared to be a pointer.
:errbad.
int a;
int b = *a;
:eerrbad.
:MSGSYM. ERR_CANT_TAKE_ADDR_OF_RVALUE
:MSGTXT. cannot take address of an rvalue
:MSGJTXT. 塃曈抣偺傾僪儗僗傪偲傞偙偲偑偱偒傑偣傫
You can only take the address of a variable or memory location.
:errbad.
char c;
char *p1 = & & c; // not allowed
char *p2 = & (c+1); // not allowed
:eerrbad.
:MSGSYM. ERR_MUST_BE_STRUCT_OR_UNION
:MSGTXT. expression for '.' must be a class, struct or union
:MSGJTXT. '.'偵懳偡傞幃偼class, struct, 傑偨偼union偱側偗傟偽側傝傑偣傫
The compiler has encountered the pattern "expression" "." "field_name"
where the expression is not a
.kw class,
.kw struct
or
.kw union
type.
:errbad.
struct S
{
int a;
};
int &fun();
int a = fun().a;
:eerrbad.
:MSGSYM. ERR_MUST_BE_PTR_TO_STRUCT_OR_UNION
:MSGTXT. expression for '->' must be pointer to class, struct or union
:MSGJTXT. '->'偵懳偡傞幃偼class, struct, 傑偨偼union傊偺億僀儞僞偱側偗傟偽側傝傑偣傫
The compiler has encountered the pattern "expression" "->"
"field_name" where the expression is not a pointer to
.kw class,
.kw struct
or
.kw union
type.
:errbad.
struct S
{
int a;
};
int *fun();
int a = fun()->a;
:eerrbad.
:MSGSYM. ERR_SYM_ALREADY_DEFINED
:MSGTXT. symbol '%S' already defined
:MSGJTXT. '%S'偼偡偱偵僔儞儃儖掕媊偝傟偰偄傑偡
The specified symbol has already been defined.
:errbad.
char a = 2;
char a = 2; // not allowed
:eerrbad.
:MSGSYM. ERR_FUNCTION_NOT_DEFINED
:MSGTXT. static function '%S' has not been defined
:MSGJTXT. 僗僞僥傿僢僋娭悢'%S'偼掕媊偝傟傑偣傫偱偟偨
A prototype has been found for a
.kw static
function, but a definition for the
.kw static
function has not been found in the file.
:errbad.
static int fun( void );
int k = fun();
// fun not defined by end of program
:eerrbad.
:MSGSYM. ERR_EXPECTING_LABEL
:MSGTXT. expecting label for goto statement
:MSGJTXT. goto暥偵懳墳偡傞儔儀儖偑偁傞偼偢偱偡
The
.kw goto
statement requires the name of a label.
:errbad.
int fun( void )
{
goto;
}
:eerrbad.
:MSGSYM. ERR_DUPLICATE_CASE_VALUE
:MSGTXT. duplicate case value '%s' found
:MSGJTXT. case偺抣'%s'偑2偮偁傝傑偡
Every case value in a
.kw switch
statement must be unique.
:errbad.
int fun( int a )
{
switch( a ) {
case 1:
return 7;
case 2:
return 9;
case 1: // duplicate not allowed
return 7;
}
return 79;
}
:eerrbad.
:MSGSYM. ERR_FIELD_TOO_WIDE
:MSGTXT. bit-field width is too large
:MSGJTXT. 價僢僩僼傿乕儖僪暆偑戝偒偡偓傑偡
The maximum field width allowed is 16 bits in the 16-bit compiler
and 32 bits in the 32-bit compiler.
:errbad.
struct S
{
unsigned bitfield :48; // too wide
};
:eerrbad.
:MSGSYM. ERR_WIDTH_0
:MSGTXT. width of a named bit-field must not be zero
:MSGJTXT. 柤慜傪偮偗傜傟偨價僢僩僼傿乕儖僪偺暆偼僛儘偱偁偭偰偼側傝傑偣傫
A bit field must be at least one bit in size.
:errbad.
struct S {
int bitfield :10;
int :0; // okay, aligns to int
int h :0; // error, field is named
};
:eerrbad.
:MSGSYM. ERR_WIDTH_NEGATIVE
:MSGTXT. bit-field width must be positive
:MSGJTXT. 價僢僩僼傿乕儖僪暆偼惓偺悢偱側偗傟偽側傝傑偣傫
You cannot have a negative field width.
:errbad.
struct S
{
unsigned bitfield :-10; // cannot be negative
};
:eerrbad.
:MSGSYM. ERR_BITFIELD_BAD_BASE_TYPE
:MSGTXT. bit-field base type must be an integral type
:MSGJTXT. 價僢僩僼傿乕儖僪偺婎杮宆偼惍悢宆偱側偗傟偽側傝傑偣傫
The types allowed for bit fields are
.kw signed
or
.kw unsigned
varieties of
.kw char,
.kw short
and
.kw int.
:errbad.
struct S
{
float bitfield : 10; // must be integral
};
:eerrbad.
:MSGSYM. ERR_EXPR_MUST_BE_ARRAY
:MSGTXT. subscript on non-array
:MSGJTXT. 旕攝楍傊偺揧偊帤偱偡
One of the operands of '[]' must be an array or a pointer.
:errbad.
int array[10];
int i1 = array[0]; // ok
int i2 = 0[array]; // same as above
int i3 = 0[1]; // illegal
:eerrbad.
:MSGSYM. ERR_INCOMPLETE_COMMENT
:MSGTXT. incomplete comment
:MSGJTXT. 晄姰慡側僐儊儞僩偱偡
The compiler did not find
.id */
to mark the end of a comment.
:MSGSYM. ERR_MUST_BE_MACRO_PARM
:MSGTXT. argument for # must be a macro parm
:MSGJTXT. #偺堷悢偼儅僋儘偺僷儔儊乕僞偱側偗傟偽側傝傑偣傫
The argument for the stringize operator '#' must be a macro parameter.
:MSGSYM. ERR_UNKNOWN_DIRECTIVE
:MSGTXT. unknown preprocessing directive '#%s'
:MSGJTXT. 枹抦偺慜張棟媅帡柦椷'#%s'偱偡
An unrecognized preprocessing directive has been encountered.
Check for correct spelling.
:errbad.
#i_goofed // not valid
:eerrbad.
:MSGSYM. ERR_INVALID_INCLUDE
:MSGTXT. invalid #include directive
:MSGJTXT. 晄揔愗側#include媅帡柦椷偱偡
A syntax error has been encountered in a
.kw #include
directive.
:errbad.
#include // no header file
#include stdio.h
:eerrbad.
Both examples are illegal.
:MSGSYM. ERR_TOO_FEW_MACRO_PARMS
:MSGTXT. not enough parameters given for macro '%s'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?