编译时的Error、Warning大全(附上生草机翻)

Maksoana 二级用户组 2023-3-19 733

A网原帖:https://forums.alliedmods.net/showthread.php?t=201044

001 - expected token: token, but found token
A required token is omitted.
002 - only a single statement (or expression) can follow each “case”
Every case in a switch statement can hold exactly one statement. To put multiple statements in a case, enclose these statements between braces (which creates a compound statement).
003 - declaration of a local variable must appear in a compound block
The declaration of a local variable must appear between braces (“{. . .}”) at the active scope level.
When the parser flags this error, a variable declaration appears as the only statement of a function or the only statement below an if, else, for, while or do statement. Note that, since local variables are accessible only from (or below) the scope that their declaration appears in, having a variable declaration as the only statement at any scope is useless.
004 - function name is not implemented
There is no implementation for the designated function. The function may have been “forwardly” declared —or prototyped— but the full function definition including a statement, or statement block, is missing.
005 - function may not have arguments
The function main is the program entry point. It may not have arguments.
006 - must be assigned to an array
String literals or arrays must be assigned to an array. This error message may also indicate a missing index (or indices) at the array on the right side of the “=” sign.
007 - operator cannot be redefined
Only a select set of operators may be redefined, this operator is not one of them. See page 84 for details.
008 - must be a constant expression; assumed zero
The size of arrays and the parameters of most directives must be constant values.
009 - invalid array size (negative, zero or out of bounds)
The number of elements of an array must always be 1 or more. In addition, an array that big that it does exceeds the range of a cell is invalid too.
010 - illegal function or declaration
The compiler expects a declaration of a global variable or of a function at the current location, but it cannot interpret it as such.
011 - invalid outside functions
The instruction or statement is invalid at a global level. Local labels and (compound) statements are only valid if used within functions.
012 - invalid function call, not a valid address
The symbol is not a function.
013 - no entry point (no public functions)
The file does not contain a main function or any public function. The compiled file thereby does not have a starting point for the execution.
014 - invalid statement; not in switch
The statements case and default are only valid inside a switch statement.
015 - “default” must be the last clause in switch statement pawn requires the default clause to be the last clause in a switch statement.
016 - multiple defaults in “switch”
Each switch statement may only have one default clause.
017 - undefined symbol symbol
The symbol (variable, constant or function) is not declared.
018 initialization data exceeds declared size
Initialization: 63
An array with an explicit size is initialized, but the number of initiallers exceeds the number of elements specified. For example, in “arr[3]={1,2,3,4};” the array is specified to have three elements, but there are four initiallers.
019 - not a label: name
A goto statement branches to a symbol that is not a label.
020 - invalid symbol name
A symbol may start with a letter, an underscore or an “at” sign (“@”) and may be followed by a series of letters, digits, underscore characters and “@” characters.
021 - symbol already defined: identifier
The symbol was already defined at the current level.
022 - must be lvalue (non-constant)
The symbol that is altered (incremented, decremented, assigned a value, etc.) must be a variable that can be modified (this kind of variable is called an lvalue). Functions, string literals, arrays and constants are no lvalues. Variables declared with the “const” attribute are no lvalues either.
023 - array assignment must be simple assignment
When assigning one array to another, you cannot combine an arithmetic operation with the assignment (e.g., you cannot use the “+=” operator).
024 - “break” or “continue” is out of context
The statements break and continue are only valid inside the context of a loop (a do, for or while statement). Unlike the languages C/C++ and Java, break does not jump out of a switch statement.
025 - function heading differs from prototype
The number of arguments given at a previous declaration of the function does not match the number of arguments given at the current declaration.
026 - no matching “#if...”
The directive #else or #endif was encountered, but no matching #if directive was found.
027 - invalid character constant
One likely cause for this error is the occurrence of an unknown escape sequence, like “\x”. Putting multiple characters between single quotes, as in ’abc’ also issues this error message. A third cause for this error is a situation where a character constant was expected, but none (or a non-character expression) were provided.
028 - invalid subscript (not an array or too many subscripts): identifier
The subscript operators “[” and “]” are only valid with arrays. The number of square bracket pairs may not exceed the number of dimensions of the array.
029 - invalid expression, assumed zero
The compiler could not interpret the expression.
030 - compound statement not closed at the end of file (started at line number)
An unexpected end of file occurred. One or more compound statements are still unfinished (i.e. the closing brace “}” has not been found). The line number where the compound statement started is given in the message.
031 - unknown directive
The character “#” appears first at a line, but no valid directive was specified.
032 - array index out of bounds
The array index is larger than the highest valid entry of the array.
033 - array must be indexed (variable name)
An array as a whole cannot be used in a expression; you must indicate an element of the array between square brackets.
034 - argument does not have a default value (argument index)
You can only use the argument placeholder when the function definition specifies a default value for the argument.
035 - argument type mismatch (argument index)
The argument that you pass is different from the argument that the function expects, and the compiler cannot convert the passed-in argument to the required type. For example, you cannot pass the literal value “1” as an argument when the function expects an array or a reference.
036 - empty statement
The line contains a semicolon that is not preceded by an expression. pawn does not support a semicolon as an empty statement, use an empty compound block instead.
037 - invalid string (possibly non-terminated string)
A string was not well-formed; for example, the final quote that ends a string is missing, or the filename for the #include directive was not enclosed in double quotes or angle brackets.
038 - extra characters on line
There were trailing characters on a line that contained a directive (a directive starts with a # symbol, see page 116).
039 - constant symbol has no size
A variable has a size (measured in a number of cells), a constant has no size. That is, you cannot use a (symbolic) constant with the sizeof operator, for example.
040 - duplicate “case” label (value value)
A preceding “case label” in the list of the switch statement evaluates to the same value.
041 - invalid ellipsis, array size is not known
You used a syntax like “arr[] = { 1, ... };”, which is invalid, because the compiler cannot deduce the size of the array from the declaration.
042 - invalid combination of class specifiers
A function or variable is denoted as both “public” and “native”, which is unsupported. Other combinations may also be unsup- ported; for example, a function cannot be both “public” and “stock” (a variable may be declared both “public” and “stock”).
043 - character constant value exceeds range for a packed string/array
When the error occurs on a literal string, it is usually an attempt to store a Unicode character in a packed string where a packed character is 8-bits. For a literal array, one of the constants does not fit in the range for packed characters.
044 - positional parameters must precede all named parameters
When you mix positional parameters and named parameters in a function call, the positional parameters must come first.
045 - too many function arguments
The maximum number of function arguments is currently limited to 64.
046 - unknown array size (variable name)
For array assignment, the size of both arrays must be explicitly defined, also if they are passed as function arguments.
047 - array sizes do not match, or destination array is too small
For array assignment, the arrays on the left and the right side of the assignment operator must have the same number of dimensions. In addition:
- for multi-dimensional arrays, both arrays must have the same size —note that an unpacked array does not fit in a packed array with the same number of elements;
- for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.
When passing arrays to a function argument, these rules also hold for the array that is passed to the function (in the function call) versus the array declared in the function definition.
When a function returns an array, all return statements must specify an array with the same size and dimensions.
048 - array dimensions do not match
For an array assignment, the dimensions of the arrays on both sides of the “=” sign must match; when passing arrays to a function argument, the arrays passed to the function (in the function call) must match with the definition of the function arguments.
When a function returns an array, all return statements must specify an array with the same size and dimensions.
049 - invalid line continuation
A line continuation character (a backslash at the end of a line) is at an invalid position, for example at the end of a file or in a single line comment.
050 - invalid range
A numeric range with the syntax “n1 .. n2”, where n1 and n2 are numeric constants, is invalid. Either one of the values in not a valid number, or n1 is not smaller than n2.
051 - invalid subscript, use “[ ]” operators on major dimensions and for named indices
You can use the “character array index” operator (braces: “{ }” only for the last dimension, and only when indexing the array with a number. For other dimensions, and when indexing the array with a “symbolic index” (one that starts with a “.”), you must use the cell index operator (square brackets: “[ ]”).
052 - multi-dimensional arrays must be fully initialized
If an array with more than one dimension is initialized at its declaration, then there must be equally many literal vectors/sub- arrays at the right of the equal sign (“=”) as specified for the major dimension(s) of the array.
053 - exceeding maximum number of dimensions
The current implementation of the pawn compiler only supports arrays with one or two dimensions.
054 - unmatched closing brace
A closing brace (“}”) was found without matching opening brace (“{”).
055 - start of function body without function header
An opening brace (“{”) was found outside the scope of a function. This may be caused by a semicolon at the end of a preceding function header.
056 - arrays, local variables and function arguments cannot be public
A local variable or a function argument starts with the character “@”, which is invalid.
057 - unfinished expression before compiler directive
Compiler directives may only occur between statements, not inside a statement. This error typically occurs when an expression statement is split over multiple lines and a compiler directive appears between the start and the end of the expression. This is not supported.
058 - duplicate argument; same argument is passed twice
In the function call, the same argument appears twice, possibly through a mixture of named and positional parameters.
059 - function argument may not have a default value (variable name)
All arguments of public functions must be passed explicitly. Public functions are typically called from the host application, who has no knowledge of the default parameter values. Arguments of user defined operators are implied from the expression and cannot be inferred from the default value of an argument.
060 - multiple “#else” directives between “#if . . . #endif
Two or more #else directives appear in the body between the matching #if and #endif.
061 - “#elseif” directive follows an “#else” directive
All #elseif directives must appear before the #else directive. This error may also indicate that an #endif directive for a higher level is missing.
062 - number of operands does not fit the operator
When redefining an operator, the number of operands that the operator has (1 for unary operators and 2 for binary operators) must be equal to the number of arguments of the operator function.
063 - function result tag of operator name must be name
Logical and relational operators are defined as having a result that is either true (1) or false (0) and having a “bool:” tag. A user defined operator should adhere to this definition.
064 - cannot change predefined operators
One cannot define operators to work on untagged values, for example, because pawn already defines this operation.
065 - function argument may only have a single tag (argument number)
In a user defined operator, a function argument may not have multiple tags.
066 - function argument may not be a reference argument or an array (argument number)
In a user defined operator, all arguments must be cells (non-arrays) that are passed “by value”.
067 - variable cannot be both a reference and an array (variable name)
A function argument may be denoted as a “reference” or as an array, but not as both.
068 - invalid rational number precision in #pragma
The precision was negative or too high. For floating point rational numbers, the precision specification should be omitted.
069 - rational number format already defined
This #pragma conflicts with an earlier #pragma that specified a different format.
070 - rational number support was not enabled
A rational literal number was encountered, but the format for rational numbers was not specified.
071 - user-defined operator must be declared before use (func- tion name)
Like a variable, a user-defined operator must be declared before its first use. This message indicates that prior to the declaration of the user-defined operator, an instance where the operator was used on operands with the same tags occurred. This may either indicate that the program tries to make mixed use of the default operator and a user-defined operator (which is unsupported), or that the user-defined operator must be “forwardly declared”.
072 - “sizeof” operator is invalid on “function” symbols
You used something like “sizeof MyCounter” where the symbol “MyCounter” is not a variable, but a function. You cannot request the size of a function.
073 - function argument must be an array (argument name)
The function argument is a constant or a simple variable, but the function requires that you pass an array.
074 - #define pattern must start with an alphabetic character
Any pattern for the #define directive must start with a letter, an underscore (“_”) or an “@”-character. The pattern is the first word that follows the #define keyword.
075 - input line too long (after substitutions)
Either the source file contains a very long line, or text substitutions make a line that was initially of acceptable length grow beyond its bounds. This may be caused by a text substitution that causes recursive substitution (the pattern matching a portion of the replacement text, so that this part of the replacement text is also matched and replaced, and so forth).
076 - syntax error in the expression, or invalid function call
The expression statement was not recognized as a valid statement (so it is a “syntax error”). From the part of the string that was parsed, it looks as if the source line contains a function call in a “procedure call” syntax (omitting the parentheses), but the function result is used —assigned to a variable, passed as a parameter, used in an expression. . .
077 - malformed UTF-8 encoding, or corrupted file: filename
The file starts with an UTF-8 signature, but it contains encodings that are invalid UTF-8. If the source file was created by an editor or converter that supports UTF-8, the UTF-8 support is non-conforming.
078 - function uses both “return” and “return <value>”
The function returns both with and without a return value. The function should be consistent in always returning with a function result, or in never returning a function result.
079 - inconsistent return types (array & non-array)
The function returns both values and arrays, which is not allowed. If a function returns an array, all return statements must specify an array (of the same size and dimensions).
080 - unknown symbol, or not a constant symbol (symbol name)
Where a constant value was expected, an unknown symbol or a non-constant symbol (variable) was found.
082 - user-defined operators and native functions may not have states
Only standard and public functions may have states.
083 - a function or variable may only belong to a single automa- ton (symbol name)
There are multiple automatons in the state declaration for the indicated function or variable, which is not supported. In the case of a function: all instances of the function must belong to the same automaton. In the case of a variable: it is allowed to have several variables with the same name belonging to different automatons, but only in separate declarations —these are distinct variables.
084 - state conflict: one of the states is already assigned to another implementation (symbol name)
The specified state appears in the state specifier of two implemen- tations of the same function.
085 - no states are defined for symbol name
When this error occurs on a function, this function has a fall-back implementation, but no other states. If the error refers to a variable, this variable does not have a list of states between the < and > characters. Use a state-less function or variable instead.
086 - unknown automaton name
The “state” statement refers to an unknown automaton.
087 - unknown state name for automaton name
The “state” statement refers to an unknown state (for the specified automaton).
088 - public variables and local variables may not have states (symbol name)
Only standard (global) variables may have a list of states (and an automaton) at the end of a declaration.
089 - state variables may not be initialized (symbol name)
Variables with a state list may not have initializers. State variables should always be initialized through an assignment (instead of at their declaration), because their initial value is indeterminate.
090 - public functions may not return arrays (symbol name)
A public function may not return an array. Returning arrays is allowed only for normal functions.
091 - first constant in an enumerated list must be initialized (symbol name)
The first constant in a list of enumerated symbolic constants must be set to a value. Any subsequent symbol is automatically set the the value of the preceding symbol +1.
092 - invalid number format
A symbol started with a digit, but is is not a valid number.
093 - array fields with a size may only appear in the final dimension
In the final dimension (the “minor” dimension), the fields of an array may optionally be declared with a size that is different from a single cell. On the major dimensions of an array, this is not valid, however.
094 - invalid subscript, subscript does not match array definition regarding named indices (symbol name)
Either the array was declared with symbolic subscripts and you are indexing it with an expression, or you are indexing the array with a symbolic subscript which is not defined for the array.
• Fatal Errors
100 - cannot read from file: filename
The compiler cannot find the specified file or does not have access to it.
101 - cannot write to file: filename
The compiler cannot write to the specified output file, probably caused by insufficient disk space or restricted access rights (the file could be read-only, for example).
102 - table overflow: table name
An internal table in the pawn parser is too small to hold the required data. Some tables are dynamically growable, which means that there was insufficient memory to resize the table. The “table name” is one of the following:
“staging buffer”: the staging buffer holds the code generated for an expression before it is passed to the peephole optimizer. The
staging buffer grows dynamically, so an overflow of the staging buffer basically is an “out of memory” error.
“loop table”: the loop table is a stack used with nested do, for, and while statements. The table allows nesting of these statements up to 24 levels.
“literal table”: this table keeps the literal constants (numbers, strings) that are used in expressions and as initiallers for arrays. The literal table grows dynamically, so an overflow of the literal table basically is an “out of memory” error.
“compiler stack”: the compiler uses a stack to store temporary information it needs while parsing. An overflow of this stack is probably caused by deeply nested (or recursive) file inclusion. The compiler stack grows dynamically, so an overflow of the compiler stack basically is an “out of memory” error.
“option table”: in case that there are more options on the command line or in the response file than the compiler can cope with.
103 - insufficient memory
General “out of memory” error.
104 - incompatible options: option versus option
Two option that are passed to the pawn compiler conflict with each other, or an option conflicts with the configuration of the pawn compiler.
105 - numeric overflow, exceeding capacity
A numeric constant, notably a dimension of an array, is too large for the compiler to handle. For example, when compiled as a 16-bit application, the compiler cannot handle arrays with more than 32767 elements.
106 - compiled script exceeds the maximum memory size
(number bytes)
The memory size for the abstract machine that is needed to run the script exceeds the value set with #pragma amxlimit. This means that the script is too large to be supported by the host.
You might try reducing the script’s memory requirements by:
- setting a smaller stack/heap area —see #pragma dynamic at page 119;
- using packed strings instead of unpacked strings —see pages 99 and 136;
- using overlays —see pages 120 and page 170 for more information on overlays.
- putting repeated code in separate functions;
- putting repeated data (strings) in global variables;
- trying to find more compact algorithms to perform the same task.
107 - too many error/warning messages on one line
A single line that causes several error/warning messages is often an indication that the pawn parser is unable to “recover” from an earlier error. In this situation, the parser is unlikely to make any sense of the source code that follows —producing only (more) inappropriate error messages. Therefore, compilation is halted.
108 - codepage mapping file not found
The file for the codepage translation that was specified with the -c compiler option or the #pragma codepage directive could not be loaded.
109 - invalid path: path name
A path, for example for include files or codepage files, is invalid. Check the compiler options and, if used, the configuration file.
110 - assertion failed: expression
Compile-time assertion failed.
111 - user error: message
The parser fell on an #error directive.
112 - overlay function name exceeds limit by value bytes
The size of a function is too large for the overlay system. To fix this issue, you will have to split the function into two (or more) functions.
• Warnings
200 - symbol is truncated to number characters
The symbol is longer than the maximum symbol length. The maximum length of a symbol depends on whether the symbol is native, public or neither. Truncation may cause different symbol names to become equal, which may cause error 021 or warning 219.
201 - redefinition of constant/macro (symbol name)
The symbol was previously defined to a different value, or the text substitution macro that starts with the prefix name was redefined with a different substitution text.
202 - number of arguments does not match definition
At a function call, the number of arguments passed to the function (actual arguments) differs from the number of formal arguments declared in the function heading. To declare functions with variable argument lists, use an ellipsis (...) behind the last known argument in the function heading; for example: print(formatstring,...); (see page 78).
203 - symbol is never used: identifier
A symbol is defined but never used. Public functions are excluded from the symbol usage check (since these may be called from the outside).
204 - symbol is assigned a value that is never used: identifier
A value is assigned to a symbol, but the contents of the symbol are never accessed.
205 - redundant code: constant expression is zero
Where a conditional expression was expected, a constant expression with the value zero was found, e.g. “while (0)” or “if (0)”. The the conditional code below the test is never executed, and it is therefore redundant.
206 - redundant test: constant expression is non-zero
Where a conditional expression was expected, a constant expression with a non-zero value was found, e.g. if (1). The test is redundant, because the conditional code is always executed.
To create an endless loop, use for ( ;; ) instead of while (1).
207 - unknown “#pragma”
The compiler ignores the pragma. The #pragma directives may change between compilers of different vendors and between different versions of a compiler of the same version.
208 - function with tag result used before definition, forcing
reparse
When a function is “used” (invoked) before being declared, and that function returns a value with a tag name, the parser must make an extra pass over the source code, because the presence of the tag name may change the interpretation of operators (in the presence of user-defined operators). You can speed up the parsing/compilation process by declaring the relevant functions before using them.
209 - function should return a value
The function does not have a return statement, or it does not have an expression behind the return statement, but the function’s result is used in a expression.
210 - possible use of symbol before initialization: identifier
A local (uninitialized) variable appears to be read before a value is assigned to it. The compiler cannot determine the actual order of reading from and storing into variables and bases its assumption of the execution order on the physical appearance order of statements an expressions in the source file.
211 - possibly unintended assignment
Where a conditional expression was expected, the assignment operator (=) was found instead of the equality operator (==). As this is a frequent mistake, the compiler issues a warning. To avoid this message, put parentheses around the expression, e.g. if ( (a=2) ).
212 - possibly unintended bitwise operation
Where a conditional expression was expected, a bitwise operator (& or |) was found instead of a Boolean operator (&& or ||). In situations where a bitwise operation seems unlikely, the compiler issues this warning. To avoid this message, put parentheses around the expression.
213 - tag mismatch
A tag mismatch occurs when:
- assigning to a tagged variable a value that is untagged or that has a different tag
- the expressions on either side of a binary operator have different tags
- in a function call, passing an argument that is untagged or that has a different tag than what the function argument was defined with
- indexing an array which requires a tagged index with no tag or a wrong tag name
214 - possibly a “const” array argument was intended: identifier
Arrays are always passed by reference. If a function does not modify the array argument, however, the compiler can sometimes generate more compact and quicker code if the array argument is specifically marked as “const”.
215 - expression has no effect
The result of the expression is apparently not stored in a variable or used in a test. The expression or expression statement is therefore redundant.
216 - nested comment
pawn does not support nested comments.
217 - loose indentation
Statements at the same logical level do not start in the same column; that is, the indents of the statements are different. Although pawn is a free format language, loose indentation frequently hides a logical error in the control flow.
The compiler can also incorrectly assume loose indentation if the tab size with which you indented the source code differs from the assumed size. This may happen if the source files use a mixture of tab and space characters to indent lines. Sometimes it is then needed to tell the pawn parser what tab size to use, see #pragma tabsize on page 121 or the compiler option -t on page 170.
You can also disable this warning with #pragma tabsize 0 or the compiler option -t:0.
218 - old style prototypes used with optional semicolon
When using “optional semicolons”, it is preferred to explicitly declare forward functions with the forward keyword than using terminating semicolon.
219 - local variable identifier shadows a symbol at a preceding level
A local variable has the same name as a global variable, a function, a function argument, or a local variable at a lower precedence level. This is called “shadowing”, as the new local variable makes the previously defined function or variable inaccessible.
Note: if there are also error messages further on in the script about missing variables (with these same names) or brace level problems, it could well be that the shadowing warnings are due to these syntactical and semantical errors. Fix the errors first before looking at the shadowing warnings.
220 - expression with tag override must appear between paren- theses
In a case statement and in expressions in the conditional operator (“ ? : ”), any expression that has a tag override should be en- closed between parentheses, to avoid the colon to be misinterpreted as a separator of the case statement or as part of the conditional operator.
221 - label name identifier shadows tag name
A code label (for the goto instruction) has the same name as a previously defined tag. This may indicate a faultily applied tag override; a typical case is an attempt to apply a tag override on the variable on the left of the = operator in an assignment statement.
222 - number of digits exceeds rational number precision
A literal rational number has more decimals in its fractional part than the precision of a rational number supports. The remaining decimals are ignored.
223 - redundant “sizeof”: argument size is always 1 (symbol name)
A function argument has a as its default value the size of another argument of the same function. The “sizeof” default value is only useful when the size of the referred argument is unspecified in
the declaration of the function; i.e., if the referred argument is an array.
224 - indeterminate array size in “sizeof” expression (symbol name)
The operand of the sizeof operator is an array with an unspecified size. That is, the size of the variable cannot be determined
at compile time. If used in an “if” instruction, consider a conditionally compiled section, replacing if by #if.
225 - unreachable code
The indicated code will never run, because an instruction before (above) it causes a jump out of the function, out of a loop or elsewhere. Look for return, break, continue and goto instructions above the indicated line. Unreachable code can also be caused by an endless loop above the indicated line.
226 - a variable is assigned to itself (symbol name)
There is a statement like “x = x” in the code. The parser checks for self assignments after performing any text and constant substitutions, so the left and right sides of an assignment may appear to be different at first sight. For example, if the symbol “TWO” is a constant with the value 2, then “var[TWO] = var[2]” is also a self-assignment.
Self-assignments are, of course, redundant, and they may hide an error (assignment to the wrong variable, error in declaring constants).
Note that the pawn parser is limited to performing “static checks” only. In this case it means that it can only compare array assignments for self-assignment with constant array indices.
227 - more initiallers than array fields
An array that is declared with sumbolic subscripts contains more values/fields as initiallers than there are (symbolic) subscripts.
228 - length of initialler exceeds size of the array field
The initialler for an array element contains more values than the size of that field allows. This occurs in an array that has symbolic subscripts, and where a particular subscript is declared with a size.
229 - mixing packed and unpacked array indexing or array assignment
An array is declared as packed (with { and } braces) but indexed as unpacked (with [ and ]), or vice versa. Or one array is assigned to another and one is packed while the other is unpacked.
230 - no implementation for state name in function name, no fall-back
A function is lacking an implementation for the indicated state. The compiler cannot (statically) check whether the function will ever be called in that state, and therefore it issues this warning. When the function would be called for the state for which no implementation exists, the abstract machine aborts with a run time error.
See page 81 on how to specify a fall-back function, and page 42 for a description and an example.
231 - state specification on forward declaration is ignored
A state specification is redundant on forward declarations. The function signature must be equal for all states. Only the imple- mentations of the function are state-specific.
232 - native function lacks a predefined index (symbol name)
The pawn compiler was configured with predefined indices for native functions, but it encountered a declaration for which it does not have an index declaration. This usually means that the script uses include files that arenot appropriate for the active configuration.
233 - state variable name shadows a global variable
The state variable has the same name as a global variable (without state specifiers). This means that the global variable is inaccessible for a function with one of the same states as those of the variable.
234 - function is deprecated (symbol name)
The script uses a function which as marked as “deprecated”. The host application can mark (native) functions as deprecated when better alternatives for the function are available or if the function may not be supported in future versions of the host application.
235 - public function lacks forward declaration (symbol name)
The script defines a public function, but no forward declaration of this function is present. Possibly the function name was written incorrectly. The requirement for forward declarations of public functions guards against a common error.
236 - unknown parameter in substitution (incorrect #define pattern)
A #define pattern contains a parameter in the replacement (e.g. “%1”), that is not in the match pattern. See page 92 for the preprocessor syntax.
237 - recursive function name
The specified function calls itself recursively. Although this is valid in pawn, a self-call is often an error. Note that this warning is only generated when the pawn parser/compiler is set to “verbose” mode.
238 - mixing string formats in concatenation
In concatenating literals strings, strings with different formats (such as packed versus unpacked, and “plain” versus standard strings) were combined. This is usually an error. The parser uses the format of the first (left-most) string in the concatenation for the result.

上传的附件:

CSGO插件分享-申明 1、本网站名称:CSGO插件分享-中文站  网址:https://bbs.csgocn.net
2、本站的宗旨在于为CSGO玩家提供一个插件分享的中文资源平台,多数插件来源于SourceMod论坛,并配以中文介绍和安装教程。
3、欢迎有能力的朋友共享有趣的CSGO插件资源。
4、本站资源大多为百度网盘,如发现链接失效,可以点: 这里进行反馈,我们会第一时间更新。
最新回复 (2)
  • Maksoana 楼主 二级用户组@Ta 2023-3-19 0
    引用 2
    001  -  预期令牌:令牌,但找到令牌
    省略了必需的令牌。
    002  -  每个“案例”后面只能有一个语句(或表达式)
    switch  语句中的每个  case  只能包含一个语句。  要将多个语句放在一个案例中,请将这些语句括在大括号之间(这会创建一个复合语句)。
    003  -  局部变量的声明必须出现在复合块中
    局部变量的声明必须出现在活动范围级别的大括号(“{.  .  .}”)之间。
    当解析器标记此错误时,变量声明将作为函数的唯一语句或  if、else、for、while  或  do  语句下方的唯一语句出现。  请注意,由于局部变量只能从(或以下)其声明所在的范围访问,因此将变量声明作为任何范围内的唯一语句是无用的。
    004  -  函数名称未实现
    指定函数没有实现。  该函数可能已被“预先”声明——或原型化——但缺少包括语句或语句块的完整函数定义。
    005  -  函数不能有参数
    函数  main  是程序的入口点。  它可能没有参数。
    006  -  必须分配给一个数组
    字符串文字或数组必须分配给数组。  此错误消息还可能指示“=”符号右侧的数组中缺少索引(或多个索引)。
    007  -  运算符不能被重新定义
    只能重新定义一组选定的运算符,此运算符不是其中之一。  有关详细信息,请参见第  84  页。
    008  -  必须是常量表达式;  假定为零
    数组的大小和大多数指令的参数必须是常量值。
    009  -  无效数组大小(负数、零或越界)
    数组的元素数必须始终为  1  或更多。  另外,大到超出单元格范围的数组也是无效的。
    010  -  非法函数或声明
    编译器期望在当前位置声明一个全局变量或一个函数,但它不能这样解释它。
    011  -  无效的外部函数
    指令或语句在全局级别无效。  局部标签和(复合)语句仅在函数内使用时才有效。
    012  -  无效的函数调用,不是有效的地址
    该符号不是函数。
    013  -  没有入口点(没有公共功能)
    该文件不包含主要功能或任何公共功能。  编译后的文件因此没有执行的起点。
    014  -  无效声明;  不在开关
    语句  case  和  default  仅在  switch  语句内有效。
    015  -  “default”必须是  switch  语句中的最后一个子句  pawn  要求  default  子句是  switch  语句中的最后一个子句。
    016  -  “开关”中的多个默认值
    每个  switch  语句只能有一个  default  子句。
    017  -  未定义的符号符号
    符号(变量、常量或函数)未声明。
    018  初始化数据超出声明的大小
    初始化:63
    已初始化具有显式大小的数组,但初始值的数量超过了指定的元素数量。  例如,在“arr[3]={1,2,3,4};”中  该数组被指定为具有三个元素,但有四个初始值。
    019  -  不是标签:名称
    goto  语句分支到一个不是标签的符号。
    020  -  无效的符号名称
    符号可以以字母、下划线或“at”符号(“@”)开头,后面可以跟一系列字母、数字、下划线字符和“@”字符。
    021  -  符号已定义:标识符
    该符号已在当前级别定义。
    022  -  必须是左值(非常量)
    被改变(递增、递减、赋值等)的符号必须是一个可以修改的变量(这种变量称为左值)。  函数、字符串文字、数组和常量都不是左值。  用“const”属性声明的变量也不是左值。
    023  -  数组赋值必须是简单赋值
    将一个数组赋值给另一个数组时,不能将算术运算与赋值结合使用(例如,不能使用“+=”运算符)。
    024  -  “中断”或“继续”断章取义
    语句  break  和  continue  仅在循环上下文(do、for  或  while  语句)内有效。  与  C/C++  和  Java  语言不同,break  不会跳出  switch  语句。
    025  -  函数标题与原型不同
    在函数的前一个声明中给出的参数数量与在当前声明中给出的参数数量不匹配。
    026  -  没有匹配的“#if...”
    遇到指令#else  或#endif,但未找到匹配的#if  指令。
    027  -  无效的字符常量
    导致此错误的一个可能原因是出现了未知的转义序列,例如“\x”。  将多个字符放在单引号之间,如“abc”也会发出此错误消息。  导致此错误的第三个原因是需要字符常量,但没有提供(或非字符表达式)。
    028  -  无效下标(不是数组或太多下标):标识符
    下标运算符“[”和“]”仅对数组有效。  方括号对的数量不能超过数组的维数。
    029  -  无效表达式,假定为零
    编译器无法解释表达式。
    030  -  复合语句未在文件末尾关闭(从行号开始)
    发生意外的文件结尾。  一个或多个复合语句仍未完成(即未找到右大括号“}”)。  复合语句开始的行号在消息中给出。
    031  -  未知指令
    字符“#”首先出现在一行中,但未指定有效指令。
    032  -  数组索引越界
    数组索引大于数组的最高有效条目。
    033  -  数组必须被索引(变量名)
    一个数组作为一个整体不能用在表达式中;  您必须在方括号之间指明数组的一个元素。
    034  -  参数没有默认值(参数索引)
    当函数定义为参数指定默认值时,您只能使用参数占位符。
    035  -  参数类型不匹配(参数索引)
    您传递的参数与函数期望的参数不同,编译器无法将传入的参数转换为所需的类型。  例如,当函数需要数组或引用时,您不能将文字值“1”作为参数传递。
    036  -  空语句
    该行包含一个前面没有表达式的分号。  pawn  不支持分号作为空语句,请改用空复合块。
    037  -  无效字符串(可能是未终止的字符串)
    字符串格式不正确;  例如,字符串结尾的最后一个引号丢失,或者  #include  指令的文件名未包含在双引号或尖括号中。
    038  -  在线额外字符
    包含指令的行上有尾随字符(指令以#  符号开头,请参见第  116  页)。
    039  -  常量符号没有大小
    变量有大小(在多个单元格中测量),常量没有大小。  也就是说,例如,您不能将(符号)常量与  sizeof  运算符一起使用。
    040  -  重复的“案例”标签(价值价值)
    switch  语句列表中前面的“case  标签”计算为相同的值。
    041  -  无效的省略号,数组大小未知
    您使用了类似“arr[]  =  {  1,  ...  };”的语法,这是无效的,因为编译器无法从声明中推断出数组的大小。
    042  -  类说明符的无效组合
    函数或变量同时表示为“public”和“native”,这是不受支持的。  其他组合也可能不受支持;  例如,一个函数不能同时是“public”和“stock”(一个变量可以同时声明为“public”和“stock”)。
    043  -  字符常量值超出压缩字符串/数组的范围
    当错误发生在文字字符串上时,通常是尝试将  Unicode  字符存储在压缩字符串中,其中压缩字符为  8  位。  对于文字数组,其中一个常量不适合压缩字符的范围。
    044  -  位置参数必须在所有命名参数之前
    当您在函数调用中混合使用位置参数和命名参数时,位置参数必须放在第一位。
    045  -  函数参数太多
    函数参数的最大数量目前限制为  64。
    046  -  未知数组大小(变量名)
    对于数组赋值,必须显式定义两个数组的大小,如果它们作为函数参数传递也是如此。
    047  -  数组大小不匹配,或者目标数组太小
    对于数组赋值,赋值运算符左右两侧的数组必须具有相同的维数。  此外:
    -  对于多维数组,两个数组必须具有相同的大小——请注意,未打包的数组不适合具有相同元素数量的打包数组;
    -  对于具有单一维度的单一数组,赋值运算符左侧的数组的大小必须等于或大于右侧的数组。
    将数组传递给函数参数时,这些规则也适用于传递给函数(在函数调用中)的数组与函数定义中声明的数组。
    当一个函数返回一个数组时,所有的返回语句必须指定一个具有相同大小和维度的数组。
    048  -  数组维度不匹配
    对于数组赋值,“=”号两边的数组维度必须匹配;  将数组传递给函数参数时,传递给函数的数组(在函数调用中)必须与函数参数的定义相匹配。
    当一个函数返回一个数组时,所有的返回语句必须指定一个具有相同大小和维度的数组。
    049-无效的续行
    换行符(行尾的反斜杠)位于无效位置,例如位于文件末尾或单行注释中。
    050  -  无效范围
    语法为“n1  ..  n2”的数字范围无效,其中  n1  和  n2  是数字常量。  其中一个值不是有效数字,或者  n1  不小于  n2。
    051  -  下标无效,在主要维度和命名索引上使用“[]”运算符
    您可以使用“字符数组索引”运算符(大括号:“{}”仅用于最后一个维度,并且仅在使用数字索引数组时使用。对于其他维度,以及使用“符号索引”(一个  以“.”开头),则必须使用单元格索引运算符(方括号:“[  ]”)。
    052  -  多维数组必须完全初始化
    如果一个多维数组在其声明时被初始化,则等号(“=”)右侧必须有与为数组的主要维度指定的相同数量的文字向量/子数组  .
    053  -  超出最大维数
    pawn  编译器的当前实现仅支持一维或二维数组。
    054  -  无与伦比的右括号
    发现右大括号  (“}”)  没有匹配的左大括号  (“{”)。
    055  -  没有函数头的函数体开始
    在函数范围之外发现了左大括号  (“{”)。  这可能是由前面函数头末尾的分号引起的。
    056  -  数组、局部变量和函数参数不能公开
    局部变量或函数参数以字符“@”开头,这是无效的。
    057  -  编译器指令前未完成的表达式
    编译器指令只能出现在语句之间,而不是语句内部。  当表达式语句拆分为多行并且编译器指令出现在表达式的开头和结尾之间时,通常会发生此错误。  这是不支持的。
    058  -  重复参数;  相同的参数被传递了两次
    在函数调用中,同一个参数出现两次,可能是通过命名参数和位置参数的混合出现。
    059  -  函数参数可能没有默认值(变量名)
    公共函数的所有参数都必须显式传递。  公共函数通常从不知道默认参数值的主机应用程序调用。  用户定义运算符的参数是从表达式中隐含的,不能从参数的默认值中推断出来。
    060  -  在“#if”之间有多个“#else”指令。  .  .  #万一
    两个或多个#else  指令出现在匹配的#if  和#endif  之间的正文中。
    061  -  “#elseif”指令在“#else”指令之后
    所有#elseif  指令必须出现在#else  指令之前。  此错误还可能表示缺少更高级别的  #endif  指令。
    062  -  操作数的数量不适合运算符
    重新定义运算符时,运算符的操作数数量(一元运算符为  1  个,二元运算符为  2  个)必须等于运算符函数的参数个数。
    063  -  运算符名称的函数结果标记必须是名称
    逻辑和关系运算符被定义为具有真  (1)  或假  (0)  的结果并具有“bool:”标记。  用户定义的运算符应遵守此定义。
    064  -  无法更改预定义的运算符
    不能定义操作符来处理未标记的值,例如,因为  pawn  已经定义了这个操作。
    065  -  函数参数只能有一个标签(参数编号)
    在用户定义的运算符中,函数参数不能有多个标签。
    066  -  函数参数不能是引用参数或数组(参数编号)
    在用户定义的运算符中,所有参数都必须是“按值”传递的单元格(非数组)。
    067  -  变量不能既是引用又是数组(变量名)
    函数参数可以表示为“引用”或数组,但不能同时表示为两者。
    068  -  #pragma  中的有理数精度无效
    精度为负或太高。  对于浮点有理数,应省略精度规范。
    069  -  有理数格式已定义
    此#pragma  与指定不同格式的早期#pragma  冲突。
    070  -  有理数支持未启用
    遇到有理数,但未指定有理数的格式。
    071  -  用户定义的运算符必须在使用前声明(函数名称)
    与变量一样,用户定义的运算符必须在首次使用前声明。  此消息表明,在声明用户定义的运算符之前,出现了在具有相同标记的操作数上使用该运算符的实例。  这可能表明程序试图混合使用默认运算符和用户定义的运算符(不受支持),或者用户定义的运算符必须“预先声明”。
    072  -  “sizeof”运算符对“function”符号无效
    您使用了类似“sizeof  MyCounter”的东西,其中符号“MyCounter”不是变量,而是函数。  您不能请求函数的大小。
    073  -  函数参数必须是数组(参数名称)
    函数参数是常量或简单变量,但该函数要求您传递一个数组。
    074  -  #define  模式必须以字母字符开头
    #define  指令的任何模式都必须以字母、下划线(“_”)或“@”字符开头。  模式是#define  关键字之后的第一个词。
    075  -  输入行太长(替换后)
    要么源文件包含很长的行,要么文本替换使最初长度可接受的行超出其范围。  这可能是由导致递归替换的文本替换引起的(模式匹配部分替换文本,因此这部分替换文本也被匹配和替换,等等)。
    076  -  表达式中的语法错误,或无效的函数调用
    表达式语句未被识别为有效语句(因此它是“语法错误”)。  从被解析的字符串部分来看,源代码行似乎包含“过程调用”语法中的函数调用(省略括号),但使用了函数结果——分配给变量,作为参数传递  ,  用在表达式中。  .  .
    077  -  格式错误的  UTF-8  编码,或损坏的文件:文件名
    该文件以  UTF-8  签名开头,但它包含无效的  UTF-8  编码。  如果源文件是由支持  UTF-8  的编辑器或转换器创建的,则  UTF-8  支持不符合要求。
    078  -  函数同时使用“return”和“return  <value>”
    该函数返回有返回值和没有返回值。  函数应该始终返回函数结果,或者从不返回函数结果。
    079  -  不一致的返回类型(数组和非数组)
    该函数返回值和数组,这是不允许的。  如果函数返回数组,则所有返回语句都必须指定一个数组(具有相同的大小和维度)。
    080  -  未知符号,或不是常量符号(符号名称)
    在预期为常量值的地方,发现了未知符号或非常量符号(变量)。
    082  -  用户定义的运算符和本机函数可能没有状态
    只有标准函数和公共函数可以有状态。
    083  -  一个函数或变量只能属于一个自动机(符号名称)
    不支持指定函数或变量的状态声明中有多个自动机。  在函数的情况下:函数的所有实例必须属于同一个自动机。  在变量的情况下:允许有多个属于不同自动机的同名变量,但只能在单独的声明中——这些是不同的变量。
    084  -  状态冲突:其中一个状态已分配给另一个实现(符号名称)
    指定的状态出现在同一函数的两个实现的状态说明符中。
    085  -  没有为符号名称定义状态
    当这个错误发生在一个函数上时,这个函数有一个回退实现,但没有其他状态。  如果错误涉及一个变量,则该变量在  <  和  >  字符之间没有状态列表。  请改用无状态函数或变量。
    086  -  未知的自动机名称
    “状态”语句指的是一个未知的自动机。
    087  -  自动机名称的未知状态名称
    “状态”语句指的是未知状态(对于指定的自动机)。
    088  -  公共变量和局部变量可能没有状态(符号名称)
    只有标准(全局)变量可以在声明末尾有一个状态列表(和一个自动机)。
    089  -  状态变量可能未初始化(符号名称)
    带有状态列表的变量可能没有初始值设定项。  状态变量应该总是通过赋值来初始化(而不是在它们的声明中),因为它们的初始值是不确定的。
    090  -  公共函数不能返回数组(符号名称)
    公共函数可能不会返回数组。  返回数组只允许用于普通函数。
    091  -  必须初始化枚举列表中的第一个常量(符号名称)
    枚举符号常量列表中的第一个常量必须设置为一个值。  任何后续符号都会自动设置为前一个符号的值  +1。
    092  -  数字格式无效
    符号以数字开头,但不是有效数字。
    093  -  具有大小的数组字段只能出现在最终维度中
    在最终维度(“次要”维度)中,可以选择使用不同于单个单元格的大小来声明数组的字段。  但是,在数组的主要维度上,这是无效的。
    094  -  无效下标,下标不匹配关于命名索引(符号名称)的数组定义
    数组是用符号下标声明的并且您正在使用表达式对其进行索引,或者您正在使用未为数组定义的符号下标对数组进行索引。
    •  致命错误
    100  -  无法读取文件:文件名
    编译器找不到指定的文件或无权访问它。
    101  -  无法写入文件:文件名
    编译器无法写入指定的输出文件,可能是由于磁盘空间不足或访问权限受限(例如,该文件可能是只读的)。
    102  -  表溢出:表名
    pawn  解析器中的内部表太小,无法容纳所需的数据。  有些表是动态增长的,这意味着没有足够的内存来调整表的大小。  “表名”是以下之一:
    “暂存缓冲区”:暂存缓冲区保存为表达式生成的代码,然后再将其传递给窥孔优化器。  这
    暂存缓冲区动态增长,因此暂存缓冲区溢出基本上是“内存不足”错误。
    “循环表”:循环表是与嵌套的  do、for  和  while  语句一起使用的堆栈。  该表允许嵌套这些语句最多  24  层。
    “文字表”:该表保存了表达式中使用的文字常量(数字、字符串)和数组的初始值。  文字表是动态增长的,所以文字表的溢出基本上是一个“内存不足”的错误。
    “编译器堆栈”:编译器使用一个堆栈来存储它在解析时需要的临时信息。  此堆栈的溢出可能是由深度嵌套(或递归)文件包含引起的。  编译器堆栈动态增长,因此编译器堆栈溢出基本上是“内存不足”错误。
    “选项表”:如果命令行或响应文件中的选项多于编译器可以处理的选项。
    103  -  内存不足
    一般“内存不足”错误。
    104  -  不兼容的选项:选项与选项
    传递给  pawn  编译器的两个选项相互冲突,或者一个选项与  pawn  编译器的配置冲突。
    105  -  数值溢出,超出容量
    数字常量,特别是数组的维度,对于编译器来说太大而无法处理。  例如,当编译为  16  位应用程序时,编译器无法处理包含超过  32767  个元素的数组。
    106  -  已编译的脚本超出最大内存大小
    (字节数)
    运行脚本所需的抽象机的内存大小超过了使用#pragma  amxlimit  设置的值。  这意味着脚本太大,主机无法支持。
    您可以尝试通过以下方式减少脚本的内存需求:
    -  设置较小的堆栈/堆区域——参见第  119  页的#pragma  dynamic;
    -  使用压缩字符串而不是解压缩字符串——参见第  99  和  136  页;
    -  使用叠加  —  有关叠加的更多信息,请参见第  120  页和第  170  页。
    -  将重复的代码放在单独的函数中;
    -  将重复数据(字符串)放入全局变量;
    -  试图找到更紧凑的算法来执行相同的任务。
    107  -  一行中有太多错误/警告消息
    导致多个错误/警告消息的一行通常表示  pawn  解析器无法从较早的错误中“恢复”。  在这种情况下,解析器不太可能理解后面的源代码——只产生(更多)不适当的错误消息。  因此,编译停止。
    108  -  未找到代码页映射文件
    无法加载使用  -c  编译器选项或  #pragma  codepage  指令指定的代码页转换文件。
    109  -  无效路径:路径名
    路径(例如包含文件或代码页文件)无效。  检查编译器选项和配置文件(如果使用)。
    110  -  断言失败:表达式
    编译时断言失败。
    111  -  用户错误:消息
    解析器遇到了#error  指令。
    112  -  覆盖函数名称超出值字节限制
    函数的大小对于覆盖系统来说太大了。  要解决此问题,您必须将函数拆分为两个(或更多)函数。
    •  警告
    200  -  符号被截断为数字字符
    符号长于最大符号长度。  符号的最大长度取决于符号是本地的、公共的还是两者都不是。  截断可能导致不同的符号名称变得相等,这可能导致错误  021  或警告  219。
    201  -  常量/宏(符号名称)的重新定义
    该符号之前被定义为不同的值,或者以前缀名称开头的文本替换宏被重新定义为不同的替换文本。
    202  -  参数数量与定义不匹配
    在函数调用中,传递给函数的参数数量(实际参数)与函数标题中声明的形式参数数量不同。  要声明具有可变参数列表的函数,请在函数标题中最后一个已知参数后面使用省略号  (...);  例如:打印(格式字符串,...);  (参见开发文档第  78  页)。
    203  -  从未使用过符号:标识符
    符号已定义但从未使用过。  公共函数被排除在符号使用检查之外(因为这些函数可能会从外部调用)。
    204  -  符号被分配了一个从未使用过的值:标识符
    一个值被分配给一个符号,但是符号的内容永远不会被访问。
    205  -  冗余代码:常量表达式为零
    在需要条件表达式的地方,找到了值为零的常量表达式,例如  “while  (0)”或“if  (0)”。  测试下面的条件代码永远不会执行,因此它是多余的。
    206  -  冗余测试:常量表达式非零
    在期望条件表达式的地方,找到了具有非零值的常量表达式,例如  如果(1)。  测试是多余的,因为条件代码总是被执行。
    要创建无限循环,请使用  for  (  ;;  )  而不是  while  (1)。
    207  -  未知的“#pragma”
    编译器忽略  pragma。  #pragma  指令可能会在不同供应商的编译器之间以及同一版本的编译器的不同版本之间发生变化。
    208  -  函数在定义前使用了标记结果,强制
    重新分析
    当一个函数在声明之前被“使用”(调用),并且该函数返回一个带有标签名称的值时,解析器必须额外传递源代码,因为标签名称的存在可能会改变运算符的解释  (在存在用户定义的运算符的情况下)。  您可以通过在使用前声明相关函数来加快解析/编译过程。
    209  -  函数应该返回一个值
    函数没有  return  语句,或者  return  语句后面没有表达式,但是函数的结果用在表达式中。
    210  -  初始化前可能使用的符号:标识符
    本地(未初始化的)变量似乎在为其赋值之前被读取。  编译器无法确定从变量读取和存储到变量的实际顺序,并且其对执行顺序的假设基于源文件中语句和表达式的物理出现顺序。
    211  -  可能是意外的分配
    在需要条件表达式的地方,找到了赋值运算符  (=)  而不是相等运算符  (==)。  由于这是一个常见的错误,编译器会发出警告。  为避免出现此消息,请在表达式周围加上括号,例如  如果((a=2))。
    212  -  可能是意外的按位运算
    在需要条件表达式的地方,发现了按位运算符(&  或  |)而不是布尔运算符(&&  或  ||)。  在按位运算似乎不太可能的情况下,编译器会发出此警告。  为避免出现此消息,请在表达式两边加上括号。
    213  -  标签不匹配
    在以下情况下会发生标签不匹配:
    -  为标记变量分配一个未标记或具有不同标记的值
    -  二元运算符两边的表达式有不同的标签
    -  在函数调用中,传递一个未标记的参数或具有与函数参数定义的标签不同的参数
    -  索引一个需要没有标签或错误标签名称的标签索引的数组
    214  -  可能是一个“常量”数组参数:标识符
    数组总是通过引用传递。  但是,如果函数不修改数组参数,并且将数组参数明确标记为“const”,编译器有时可以生成更紧凑、更快速的代码。
    215  -  表达式无效
    表达式的结果显然没有存储在变量中或用于测试。  因此表达式或表达式语句是多余的。
    216  -  嵌套评论
    pawn  不支持嵌套注释。
    217  -  松散缩进
    同一逻辑级别的语句不在同一列开始;  也就是说,语句的缩进不同。  尽管  pawn  是一种自由格式语言,但松散的缩进经常隐藏控制流中的逻辑错误。
    如果用于缩进源代码的制表符大小与假定的大小不同,编译器也可能错误地假定松散缩进。  如果源文件混合使用制表符和空格字符来缩进行,则可能会发生这种情况。  有时需要告诉  pawn  解析器使用什么制表符大小,请参阅第  121  页的#pragma  tabsize  或第  170  页的编译器选项  -t。
    您还可以使用  #pragma  tabsize  0  或编译器选项  -t:0  禁用此警告。
    218  -  与可选分号一起使用的旧样式原型
    使用“可选分号”时,最好使用  forward  关键字显式声明前向函数,而不是使用终止分号。
    219  -  局部变量标识符隐藏了前一层的符号
    局部变量与全局变量、函数、函数参数或较低优先级的局部变量同名。  这称为“阴影”,因为新的局部变量使先前定义的函数或变量不可访问。
    注意:如果脚本中还有关于缺少变量(具有相同名称)的错误消息或大括号级别的问题,阴影警告很可能是由于这些句法和语义错误造成的。  在查看阴影警告之前先修复错误。
    220  -  带有标记覆盖的表达式必须出现在括号之间
    在  case  语句和条件运算符(“?:”)中的表达式中,任何具有标记覆盖的表达式都应括在括号中,以避免冒号被误解为  case  语句的分隔符或部分  的条件运算符。
    221  -  标签名称标识符影子标签名称
    代码标签(用于  goto  指令)与先前定义的标签具有相同的名称。  这可能表明错误地应用了标签覆盖;  一个典型的例子是尝试在赋值语句中  =  运算符左侧的变量上应用标记覆盖。
    222  -  位数超过有理数精度
    文字有理数在其小数部分的小数位数多于有理数支持的精度。  其余的小数点将被忽略。
    223  -  冗余“sizeof”:参数大小始终为  1(符号名称)
    函数参数的默认值是同一函数的另一个参数的大小。  “sizeof”默认值仅在引用参数的大小未指定时才有用
    函数的声明;  即,如果引用的参数是一个数组。
    224  -  “sizeof”表达式(符号名称)中的不确定数组大小
    sizeof  运算符的操作数是一个未指定大小的数组。  即无法确定变量的大小
    在编译时。  如果在“if”指令中使用,请考虑条件编译部分,将  if  替换为  #if。
    225  -  无法访问的代码
    指示的代码将永远不会运行,因为它之前(上方)的指令会导致跳出函数、跳出循环或其他地方。  在指定行上方查找返回、中断、继续和转到指令。  无法访问的代码也可能由指示行上方的无限循环引起。
    226  -  一个变量被分配给它自己(符号名称)
    代码中有类似“x  =  x”的语句。  解析器在执行任何文本和常量替换后检查自赋值,因此赋值的左侧和右侧乍一看可能不同。  例如,如果符号“TWO”是一个值为  2  的常量,那么“var[TWO]  =  var[2]”也是一个自赋值。
    自我赋值当然是多余的,它们可能会隐藏错误(赋值给错误的变量,声明常量时出错)。
    请注意,pawn  解析器仅限于执行“静态检查”。  在这种情况下,这意味着它只能将自赋值的数组赋值与常量数组索引进行比较。
    227  -  首字母多于数组字段
    使用符号下标声明的数组包含比(符号)下标更多的值/字段作为初始值。
    228  -  initialler  的长度超过数组字段的大小
    数组元素的初始值包含的值多于该字段允许的大小。  这发生在具有符号下标的数组中,并且在其中声明了特定下标的大小。
    229  -  混合打包和解包数组索引或数组赋值
    数组被声明为打包(使用  {  和  }  大括号)但索引为未打包(使用  [  和  ]),反之亦然。  或者一个数组被分配给另一个数组,一个被打包,另一个被解包。
    230  -  函数名称中的状态名称没有实现,没有回退
    函数缺少指示状态的实现。  编译器无法(静态地)检查该函数是否会在该状态下被调用,因此会发出此警告。  当为不存在实现的状态调用该函数时,抽象机将因运行时错误而中止。
    有关如何指定回退功能的信息,请参见第  81  页,有关说明和示例,请参见第  42  页。
    231  -  前向声明的状态规范被忽略
    状态规范在前向声明中是多余的。  所有状态的函数签名必须相同。  只有函数的实现是特定于状态的。
    232  -  本机函数缺少预定义索引(符号名称)
    pawn  编译器配置了用于本机函数的预定义索引,但它遇到了一个没有索引声明的声明。  这通常意味着脚本使用了不适合活动配置的包含文件。
    233  -  状态变量名称隐藏了一个全局变量
    状态变量与全局变量同名(没有状态说明符)。  这意味着全局变量对于具有与变量相同状态之一的函数是不可访问的。
    234  -  功能已弃用(符号名称)
    该脚本使用了一个标记为“已弃用”的函数。  当函数有更好的替代方案可用或如果主机应用程序的未来版本可能不支持该功能。
    235  -  公共函数缺少前向声明(符号名称)
    该脚本定义了一个公共函数,但不存在该函数的前向声明。  可能是函数名写错了。  对公共函数进行前向声明的要求可以防止常见错误。
    236  -  替换中的未知参数(不正确的#define  模式)
    #define  模式在替换中包含一个不在匹配模式中的参数(例如“%1”)。  有关预处理器语法,请参见第  92  页。
    237  -  递归函数名称
    指定的函数递归调用自身。  虽然这在  pawn  中有效,但自调用通常是错误的。  请注意,仅当  pawn  解析器/编译器设置为“详细”模式时才会生成此警告。
    238  -  在连接中混合字符串格式
    在连接文字字符串时,具有不同格式的字符串(例如打包与未打包,以及“普通”与标准字符串)被组合在一起。  这通常是一个错误。  解析器使用结果串联中第一个(最左边)字符串的格式。
  • 中学时代 一级用户组@Ta 1月前 0
    引用 3
    nb,那error  417是什么?
返回