cerrs.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 1,814 行 · 第 1/5 页
GML
1,814 行
.kw #if
directives is confined to the same source file.
This warning may often come before an error
and it is hoped will provide information to
solve a preprocessing directive problem.
:MSGSYM. ERR_LOSE_PRECISION
:MSGTXT. Possible loss of precision
:MSGJTXT. 惛搙偑棊偪偰偄傞壜擻惈偑偁傝傑偡丅
:WARNING. 1
.np
This warning indicates that you may be converting a argument
of one size to another, different size. For instance, you may be
losing precision by passing a long argument to a function that
takes a short.
This warning is initially disabled. It must be explicitly enabled with
.us #pragma enable_message(130)
or option "-wce=130". It can be disabled later by using
.us #pragma disable_message(130).
:MSGSYM. ERR_ASSUMED_IMPORT
:MSGTXT. No prototype found for function '%s'
:MSGJTXT. '%s'偺僾儘僩僞僀僾偑偁傝傑偣傫
:WARNING. 1
.np
A reference for a function appears in your program, but you do not
have a prototype for that function defined. Implicit prototype will
be used, but this will cause problems if the assumed prototype does
not match actual function definition.
:MSGSYM. ERR_NO_STG_OR_TYPE
:MSGTXT. No storage class or type specified
:MSGJTXT. 婰壇僋儔僗傑偨偼宆偑巜掕偝傟偰偄傑偣傫
:WARNING. 1
.np
When declaring a data object, either storage class or data type must be
given. If no type is specified,
.kw int
is assumed. If no storage class is specified, the default depends on
scope (see the
.us C Language Reference
for details). For instance
.errgood
auto i;
.eerrgood
is a valid declaration, as is
.errgood
short i;
.eerrgood
However,
.errbad
i;
.eerrbad
is not a correctly formed declaration.
:MSGSYM. ERR_SYMBOL_NAME_TOO_LONG
:MSGTXT. Symbol name truncated for '%s'
:MSGJTXT. 僔儞儃儖柤偑'%s'偵愗幪偰傜傟傑偟偨
:WARNING. 1
.np
Symbol is longer than the object file format allows and has been truncated
to fit. Maximum length is 255 characters for OMF and 1024 characters for
COFF or ELF object files.
:MSGSYM. ERR_SHIFT_AMOUNT_NEGATIVE
:MSGTXT. Shift amount negative
:MSGJTXT. 僔僼僩検偑晧偱偡
:WARNING. 1
.np
The right operand of a left or right shift operator is a negative value.
The result of the shift operation is undefined.
:errbad.
int a = 1 << -2;
:eerrbad.
The value of 'a' in the above example is undefined.
:MSGSYM. ERR_SHIFT_AMOUNT_TOO_BIG
:MSGTXT. Shift amount too large
:MSGJTXT. 僔僼僩検偑戝偒夁偓傑偡
:WARNING. 1
.np
The right operand of a left or right shift operator is a value greater than
or equal to the width in bits of the type of the promoted left operand.
The result of the shift operation is undefined.
:errbad.
int a = 1 >> 123;
:eerrbad.
The value of 'a' in the above example is undefined.
:MSGSYM. ERR_COMPARE_UNSIGNED_VS_ZERO
:MSGTXT. Comparison equivalent to 'unsigned == 0'
:MSGJTXT. 斾妑偺寢壥偼忢偵%d偱偡
:WARNING. 1
.np
Comparing an unsigned expression to see whether it is <= 0 is equivalent to
testing for == 0.
Check to see if the expression should be signed instead of unsigned.
:MSGSYM. ERR_FUNCTION_STG_CLASS_REDECLARED
:MSGTXT. Extern function '%s' redeclared as static
:MSGJTXT. 奜晹娭悢'%s'偼static偲偟偰嵞愰尵偝傟傑偟偨
:WARNING. 1
.np
The specified function was either explicitly or implicitly declared as
.kw extern
and later redeclared as
.kw static.
This is not allowed in ISO C and may produce unexpected results with ISO
compliant compilers.
:errbad.
int bar( void );
void foo( void )
{
bar();
}
static int bar( void )
{
return( 0 );
}
:eerrbad.
:MSGSYM. ERR_NO_EOL_BEFORE_EOF
:MSGTXT. No newline at end of file
:MSGJTXT. 僼傽僀儖偺嵟屻偵夵峴暥帤偑偁傝傑偣傫
:WARNING. 1
ISO C requires that a non-empty source file must include a newline character
at the end of the last line. If no newline was found, it will be automatically
inserted.
:eMSGGRP. Warn1
:cmt -------------------------------------------------------------------
:MSGGRP. Warn2
:MSGGRPSTR. W
:MSGGRPNUM. 200
:MSGGRPTXT. Warning Level 2 Messages
:cmt -------------------------------------------------------------------
:MSGSYM. ERR_SYM_NOT_ASSIGNED
:MSGTXT. '%s' has been referenced but never assigned a value
:MSGJTXT. '%s'偼嶲徠偝傟傑偟偨偑丆抣偑戙擖偝傟偰偄傑偣傫
:WARNING. 2
.np
You have used the variable in an expression without previously assigning
a value to that variable.
:MSGSYM. ERR_DEAD_CODE
:MSGTXT. Unreachable code
:MSGJTXT. 幚峴偝傟側偄僐乕僪偱偡
:WARNING. 2
.np
The statement will never be executed, because there is no path through
the program that causes control to reach this statement.
:MSGSYM. ERR_SYM_NOT_REFERENCED
:MSGTXT. Symbol '%s' has been defined, but not referenced
:MSGJTXT. 僔儞儃儖'%s'偑掕媊偝傟傑偟偨偑丆嶲徠偝傟傑偣傫偱偟偨
:WARNING. 2
.np
There are no references to the declared variable.
The declaration for the variable can be deleted.
.np
In some cases, there may be a valid reason for retaining the variable.
You can prevent the message from being issued through use of
.us #pragma off(unreferenced).
:MSGSYM. ERR_UNDECLARED_PP_SYM
:MSGTXT. Preprocessing symbol '%s' has not been declared
:MSGJTXT. 慜張棟僔儞儃儖'%s'偑丆愰尵偝傟傑偣傫偱偟偨
:WARNING. 2
.np
The symbol has been used in a preprocessor expression.
The compiler assumes the symbol has a value of 0 and continues.
A
.id #define
may be required for the symbol, or you may have forgotten
to include the file which contains a
.id #define
for the symbol.
:eMSGGRP. Warn2
:cmt -------------------------------------------------------------------
:MSGGRP. Warn3
:MSGGRPSTR. W
:MSGGRPNUM. 300
:MSGGRPTXT. Warning Level 3 Messages
:cmt -------------------------------------------------------------------
:MSGSYM. ERR_NESTED_COMMENT
:MSGTXT. Nested comment found in comment started on line %u
:MSGJTXT. %u峴偐傜巒傑傞僐儊儞僩偺拞偵丆僱僗僩偵偝傟偨僐儊儞僩偑偁傝傑偡
:WARNING. 3
.np
While scanning a comment for its end, the compiler detected
.id /*
for the start of another comment.
Nested comments are not allowed in ISO C.
You may be missing the
.id */
for the previous comment.
:MSGSYM. ERR_UNUSED_2
:MSGTXT. not used
:MSGJTXT. 偙偺儊僢僙乕僕偼巊梡偝傟傑偣傫
:WARNING. 2
unused message
:MSGSYM. ERR_USEFUL_SIDE_EFFECT
:MSGTXT. Expression is only useful for its side effects
:MSGJTXT. 偙偺幃偼暃嶌梡偺傒傪婲偙偟傑偡
:WARNING. 3
.np
You have an expression that would have generated the warning
"Meaningless use of an expression", except that it also contains
a side-effect, such as ++, &minus.&minus., or a function call.
:MSGSYM. ERR_PARM_NOT_REFERENCED
:MSGTXT. Parameter '%s' has been defined, but not referenced
:MSGJTXT. 僷儔儊乕僞'%s'偼掕媊偝傟傑偟偨偑丆嶲徠偝傟傑偣傫偱偟偨
:WARNING. 3
.np
There are no references to the declared parameter.
The declaration for the parameter can be deleted.
Since it is a parameter to a function, all calls to the function
must also have the value for that parameter deleted.
.np
In some cases, there may be a valid reason for retaining the parameter.
You can prevent the message from being issued through use of
.us #pragma off(unreferenced).
.np
This warning is initially disabled. It must be specifically enabled with
.us #pragma enable_message(303)
or option "-wce=303". It can be disabled later by using
.us #pragma disable_message(303).
:MSGSYM. ERR_NO_RET_TYPE_GIVEN
:MSGTXT. Return type 'int' assumed for function '%s'
:MSGJTXT. 娭悢'%s'偺栠傝宆偼int偲傒側偟傑偡
:WARNING. 3
.np
If a function is declared without specifying return type, such as
.errbad
foo( void );
.eerrbad
then its return type will be assumed to be
.kw int
.
:MSGSYM. ERR_NO_DATA_TYPE_GIVEN
:MSGTXT. Type 'int' assumed in declaration of '%s'
:MSGJTXT. '%s'偺愰尵偵偍偗傞宆偼int偲傒側偟傑偡
:WARNING. 3
.np
If an object is declared without specifying its type, such as
.errbad
register count;
.eerrbad
then its type will be assumed to be
.kw int
.
:MSGSYM. ERR_ASSEMBLER_WARNING
:MSGTXT. Assembler warning: '%s'
:MSGJTXT. 傾僙儞僽儔寈崘: '%s'
:WARNING. 3
.np
A problem has been detected by the in-line assembler.
The message indicates the problem detected.
:MSGSYM. ERR_OBSOLETE_FUNC_DECL
:MSGTXT. Obsolete non-prototype declarator
:MSGJTXT. 攑巭偝傟偨旕僾儘僩僞僀僾愰尵巕偱偡
:WARNING. 3
.np
Function parameter declarations containing only empty parentheses,
that is, non-prototype declarations, are an obsolescent language feature.
Their use is dangerous and discouraged.
.errbad
int func();
.eerrbad
:MSGSYM. ERR_NONPROTO_FUNC_CALLED
:MSGTXT. Unprototyped function '%s' called
:MSGJTXT. 旕僾儘僩僞僀僾偺娭悢'%s'偑屇偽傟傑偟偨
:WARNING. 3
.np
A call to an unprototyped function was made, preventing the compiler
from checking the number of function arguments and their types. Use
of unprototyped functions is obsolescent, dangerous and discouraged.
.errbad
int func();
void bar( void )
{
func( 4, "s" ); /* possible argument mismatch */
}
.eerrbad
:MSGSYM. ERR_NONPROTO_FUNC_CALLED_INDIRECT
:MSGTXT. Unprototyped function indirectly called
:MSGJTXT. 旕僾儘僩僞僀僾偺娭悢偑娫愙揑偵屇偽傟傑偟偨
:WARNING. 3
.np
An indirect call to an unprototyped function was made, preventing the
compiler from checking the number of function arguments and their types.
Use of unprototyped functions is obsolescent, dangerous and discouraged.
.errbad
int (*func)();
void bar( void )
{
func( 4, "s" ); /* possible argument mismatch */
}
.eerrbad
:eMSGGRP. Warn3
:cmt -------------------------------------------------------------------
:MSGGRP. Errs
:MSGGRPSTR. E
:MSGGRPNUM. 1000
:MSGGRPTXT. Error Messages
:cmt -------------------------------------------------------------------
:MSGSYM. ERR_MISPLACED_BREAK
:MSGTXT. BREAK must appear in while, do, for or switch statement
:MSGJTXT. BREAK偼while, do, for, switch暥偺拞偵側偗傟偽側傝傑偣傫
.np
A
.kw break
statement has been found in an illegal place in the program.
You may be missing an opening brace
.id {
for a
.kw while,
.kw do,
.kw for
or
.kw switch
statement.
:MSGSYM. ERR_MISPLACED_CASE
:MSGTXT. CASE must appear in switch statement
:MSGJTXT. CASE偼switch暥偺拞偵側偗傟偽側傝傑偣傫
.np
A
.kw case
label has been found that is not inside a
.kw switch
statement.
:MSGSYM. ERR_MISPLACED_CONTINUE
:MSGTXT. CONTINUE must appear in while, do or for statement
:MSGJTXT. CONTINUE偼while, do, for暥偺拞偵側偗傟偽側傝傑偣傫
.np
The
.kw continue
statement must be inside a
.kw while,
.kw do
or
.kw for
statement.
You may have too many
.id }
between the
.kw while,
.kw do
or
.kw for
statement and the
.kw continue
statement.
:MSGSYM. ERR_MISPLACED_DEFAULT
:MSGTXT. DEFAULT must appear in switch statement
:MSGJTXT. DEFAULT偼switch暥偺拞偵側偗傟偽側傝傑偣傫
.np
A
.kw default
label has been found that is not inside a
.kw switch
statement.
You may have too many
.id }
between the start of the
.kw switch
and the
.kw default
label.
:MSGSYM. ERR_MISPLACED_RIGHT_BRACE
:MSGTXT. Misplaced '}' or missing earlier '{'
:MSGJTXT. 娫堘偭偨埵抲偵'}'偑偁傞偐丆傕偭偲慜偵偁傞傋偒'{'偑偁傝傑偣傫
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?