messages.gml

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

GML
2,168
字号
:cmt ***************************************************************************
:cmt *
:cmt *                            Open Watcom Project
:cmt *
:cmt *    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
:cmt *
:cmt *  ========================================================================
:cmt *
:cmt *    This file contains Original Code and/or Modifications of Original
:cmt *    Code as defined in and that are subject to the Sybase Open Watcom
:cmt *    Public License version 1.0 (the 'License'). You may not use this file
:cmt *    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
:cmt *    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
:cmt *    provided with the Original Code and Modifications, and is also
:cmt *    available at www.sybase.com/developer/opensource.
:cmt *
:cmt *    The Original Code and all software distributed under the License are
:cmt *    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
:cmt *    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
:cmt *    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
:cmt *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
:cmt *    NON-INFRINGEMENT. Please see the License for the specific language
:cmt *    governing rights and limitations under the License.
:cmt *
:cmt *  ========================================================================
:cmt *
:cmt * Description:  C++ compiler diagnostic messages.
:cmt *
:cmt ***************************************************************************
:cmt

:cmt    Word usage:
:cmt
:cmt    'parameter' is used for macro parms
:cmt    'argument' is used for function arguments

:cmt    GML Macros used (see MSGMACS.GML):

:cmt        :ansi <n>   warning if extensions enabled, error otherwise
:cmt        :ansierr    ignored if extensions enabled, error otherwise
:cmt        :ansiwarn <n>   ignored if extensions enabled, warn otherwise
:cmt        :warning <n>    message is a warning with a specific level
:cmt        :info       informational message
:cmt
:cmt        :msgsym <sym>   internal symbolic name for message
:cmt        :msgtxt <text>  text for message
:cmt
:cmt        :msglvl     start of header title for a group of messages
:cmt        :emsglvl    end of header title for a group of messages
:cmt        :errbad     start of an example that generates an error msg
:cmt        :eerrbad    end of an example that generates an error msg
:cmt        :errgood    start of an example that compiles clean
:cmt        :eerrgood   end of an example that compiles clean
:cmt
:cmt        .kw     highlight a keyword
:cmt        .id     highlight an identifier
:cmt        .ev     highlight an environment variable
:cmt        .us     italicize a phrase
:cmt        .np     start a new paragraph

:cmt    The following substitutions are made:
:cmt        &incvarup   environment variable for include path
:cmt        &wclname    Compile and Link utility name

:cmt    Note for translators:

:cmt    Japanese error messages are supported via the :MSGJTXT tag.
:cmt    If there is no :MSGJTXT. for a particular :MSGSYM. then the
:cmt    message will come out in English.  Translation may proceed
:cmt    by translating error messages that do not have the :MSGJTXT.
:cmt    tag present and adding the :MSGJTXT. tag with the Japanese
:cmt    text after the :MSGTXT. tag.  If the :MSGJTXT. has no text
:cmt    then the error message must also be translated.  This has
:cmt    been found to be easier when searching for messages that
:cmt    still need to be translated.

:MSGSYM. ERR_CALL_WATCOM
:MSGTXT. internal compiler error
:MSGJTXT. 撪晹偺僐儞僷僀儔丒僄儔乕
If this message appears, please report the problem directly to the
Open Watcom development team. See http://www.openwatcom.org/.

:MSGSYM. WARN_ASSIGN_CONST_IN_BOOL_EXPR
:MSGTXT. assignment of constant found in boolean expression
:MSGJTXT. 掕悢偺戙擖偑榑棟幃偺拞偵偁傝傑偡
:WARNING. 3
An assignment of a constant has been detected in a boolean expression.
For example: "if( var = 0 )".
It is most likely that you want to use "==" for testing for equality.

:MSGSYM. WARN_CONSTANT_TOO_BIG
:MSGTXT. constant out of range; truncated
:MSGJTXT. 掕悢偑斖埻奜偱偡丟愗傝媗傔傜傟傑偡
:WARNING. 1
This message is issued if a constant cannot be represented in 32 bits
or if a constant is outside the range of valid values
that can be assigned to a variable.
:errbad.
int a = 12345678901234567890;
:eerrbad.

:MSGSYM. ERR_MISSING_RETURN_VALUE
:MSGTXT. missing return value
:MSGJTXT. 栠傝抣偑偁傝傑偣傫
A function has been declared with a non-void return type, but no
.kw return
statement was found in the function.  Either add a
.kw return
statement or change the function return type to
.kw void.
:errbad.
int foo( int a )
{
    int b = a + a;
}
:eerrbad.
The message will be issued at the end of the function.

:MSGSYM. WARN_BASE_CLASS_HAS_NO_VDTOR
:MSGTXT. base class '%T' does not have a virtual destructor
:MSGJTXT. 婎掙僋儔僗'%T'偼壖憐僨僗僩儔僋僞傪帩偪傑偣傫
:WARNING. 1
A virtual destructor has been declared in a class with base classes.
However, one of those base classes does not have a virtual
destructor. A
.kw delete
of a pointer cast to such a base class will not function properly
in all circumstances.
:errbad.
struct Base {
    ~Base();
};
struct Derived : Base {
    virtual ~Derived();
};
:eerrbad.
It is considered good programming practice to declare virtual
destructors in all classes used as base classes of classes having
virtual destructors.

:MSGSYM. WARN_POINTER_TRUNCATION
:MSGTXT. pointer or reference truncated
:MSGJTXT. 億僀儞僞偁傞偄偼嶲徠偑愗傝媗傔傜傟傑偡
:WARNING. 1
The expression contains a transfer of a pointer value to another
pointer value of smaller size.  This can be caused by
.kw __near
or
.kw __far
qualifiers (i.e., assigning a
.kw far
pointer to a
.kw 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.
:errbad.
extern int __far *foo();
int __far *p_far = foo();
int __near *p_near = p_far; // truncated
:eerrbad.

:MSGSYM. ERR_SYNTAX_MISSING_SEMICOLON
:MSGTXT. syntax error; probable cause: missing ';'
:MSGJTXT. 峔暥僄儔乕丟 ';'偑側偄壜擻惈偑偁傝傑偡
The compiler has found a complete expression (or declaration) during
parsing but could not continue.  The compiler has detected that it could
have continued if a semicolon was present so there may be a semicolon
missing.
:errbad.
enum S {
}   // missing ';'

class X {
};
:eerrbad.

:MSGSYM. WARN_ADDR_OF_ARRAY
:MSGTXT. '&array' may not produce intended result
:MSGJTXT. '&array'偼堄恾偝傟偨寢壥傪惗偠側偄偐傕偟傟傑偣傫
:WARNING. 3
The type of the expression '&array' is different from the type of the
expression 'array'.
Suppose we have the declaration
.id char buffer[80].
Then the expression
.id (&buffer + 3)
will be evaluated as
.id (buffer + 3 * sizeof(buffer))
which is
.id (buffer + 3 * 80)
and not
.id (buffer + 3 * 1)
which is what one may have expected.
The address-of operator '&' is not required for getting the address of an
array.

:MSGSYM. WARN_RET_ADDR_OF_AUTO
:MSGTXT. returning address of function argument or of auto or register variable
:MSGJTXT. 娭悢堷悢傑偨偼帺摦乛儗僕僗僞曄悢偺傾僪儗僗傪曉偟偰偄傑偡
:WARNING. 1
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.
:errbad.
int *foo()
{
    int k = 123;
    return &k;      // k is automatic variable
}
:eerrbad.

:MSGSYM. ERR_INVALID_OPTION_FILE
:MSGTXT. option requires a file name
:MSGJTXT. 僆僾僔儑儞偼僼傽僀儖柤傪昁梫偲偟傑偡
The specified option is not recognized by the compiler
since there was no file name after it (i.e., "-fo=my.obj" ).

:MSGSYM. WARN_ASM_IGNORED
:MSGTXT. asm directive ignored
:MSGJTXT. asm媅帡柦椷偑柍帇偝傟傑偟偨
:WARNING. 1
The asm directive (e.g., asm( "mov r0,1" ); ) is a non-portable construct.
The Open Watcom C++ compiler treats all asm directives like comments.

:MSGSYM. WARN_ALL_PRIVATE_IN_CLASS
:MSGTXT. all members are private
:MSGJTXT. 偡傋偰偺儊儞僶偼僾儔僀儀乕僩偱偡
:WARNING. 3
This message warns the programmer that there will be no way to use the
contents of the class because all accesses will be flagged as erroneous
(i.e., accessing a private member).
:errbad.
class Private {
    int a;
    Private();
    ~Private();
    Private( const Private& );
};
:eerrbad.

:MSGSYM. ERR_INVALID_TEMPLATE_ARG_TYPE
:MSGTXT. template argument cannot be type '%T'
:MSGJTXT. 僥儞僾儗乕僩堷悢偼'%T'宆偱偁傞偙偲偑偱偒傑偣傫
A template argument can be either a generic type (e.g.,
.id template < class
T
.id >
), a pointer, or an integral type.
These types are required for expressions that can be checked at compile time.

:MSGSYM. WARN_DEAD_CODE
:MSGTXT. unreachable code
:MSGJTXT. 僐乕僪偼幚峴偝傟傑偣傫
:WARNING. 2
The indicated statement will never be executed because there is no path
through the program that causes control to reach that statement.
:errbad.
void foo( int *p )
{
    *p = 4;
    return;
    *p = 6;
}
:eerrbad.
The statement following the
.kw return
statement cannot be reached.

:MSGSYM. WARN_SYM_NOT_REFERENCED
:MSGTXT. no reference to symbol '%S'
:MSGJTXT. 僔儞儃儖'%S'傊偺嶲徠偑偁傝傑偣傫
:WARNING. 2
There are no references to the declared variable.
The declaration for the variable 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.
.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),
or adding a statement that assigns the variable to itself.

:MSGSYM. WARN_NESTED_COMMENT
:MSGTXT. nested comment found in comment started on line %u
:MSGJTXT. %u峴偐傜巒懸偭偨僐儊儞僩偺拞偵僱僗僩偵偝傟偨僐儊儞僩偑偁傝傑偡
:WARNING. 3
While scanning a comment for its end, the compiler detected
.id /*
for the start of another comment.
Nested comments are not allowed in ISO/ANSI C.
You may be missing the
.id */
for the previous comment.

:MSGSYM. ERR_TEMPLATE_MUST_HAVE_ARGS
:MSGTXT. template argument list cannot be empty
:MSGJTXT. 僥儞僾儗乕僩堷悢儕僗僩偼丆嬻偱偁傞偙偲偑偱偒傑偣傫
An empty template argument list would result in a template that
could only define a single class or function.

:MSGSYM. WARN_UNREFERENCED_LABEL
:MSGTXT. label '%s' has not been referenced by a goto
:MSGJTXT. 儔儀儖'%s'偼goto偵傛偭偰嶲徠偱偒傑偣傫
:WARNING. 3
The indicated label has not been referenced and, as such, is useless.
This warning can be safely ignored.
:errgood.
int foo( int a, int b )
{
un_refed:
    return a + b;
}
:eerrgood.

:MSGSYM. WARN_ANON_NOT_REFERENCED
:MSGTXT. no reference to anonymous union member '%S'
:MSGJTXT. 柤慜柍偟偺嫟梡懱偺儊儞僶乕'%S'傊偺嶲徠偑偁傝傑偣傫
:WARNING. 2
The declaration for the anonymous member can be safely deleted without
any effect.

:MSGSYM. ERR_MISPLACED_BREAK
:MSGTXT. 'break' may only appear in a for, do, while, or switch statement
:MSGJTXT. 'break'偼for, do, switch暥偺拞偱偺傒巊偊傑偡
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.
:errbad.
int foo( int a, int b )
{
    break;  // illegal
    return a+b;
}
:eerrbad.

:MSGSYM. ERR_MISPLACED_CASE
:MSGTXT. 'case' may only appear in a switch statement
:MSGJTXT. 'case'偼switch暥偱偺傒巊偊傑偡
A
.kw case
label has been found that is not inside a
.kw switch
statement.
:errbad.
int foo( int a, int b )
{
    case 4:    // illegal
    return a+b;
}
:eerrbad.

:MSGSYM. ERR_MISPLACED_CONTINUE
:MSGTXT. 'continue' may only appear in a for, do, or while statement
:MSGJTXT. 'continue'偼for, do, while暥偱偺傒巊偊傑偡
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.
:errbad.
int foo( int a, int b )
{
    continue;   // illegal
    return a+b;
}
:eerrbad.

:MSGSYM. ERR_MISPLACED_DEFAULT
:MSGTXT. 'default' may only appear in a switch statement
:MSGJTXT. 'default'偼switch暥偱偺傒巊偊傑偡
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.
:errbad.
int foo( int a, int b )
{
    default: // illegal
    return a+b;
}
:eerrbad.

:MSGSYM. ERR_MISPLACED_RIGHT_BRACE
:MSGTXT. misplaced '}' or missing earlier '{'
:MSGJTXT. '}'偺埵抲偑娫堘偭偰偄傞偐丆傕偭偲慜偵偁傞偼偢偺'{'偑偁傝傑偣傫
An extra
.id }
has been found which cannot be matched up with an earlier
.id {.

:MSGSYM. ERR_MISPLACED_ELIF
:MSGTXT. misplaced #elif directive
:MSGJTXT. #elif媅帡柦椷偺埵抲偑娫堘偭偰偄傑偡
The
.kw #elif
directive must be inside an
.kw #if

⌨️ 快捷键说明

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