⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msg.txt

📁 PC-Lint是一种静态代码检测工具
💻 TXT
📖 第 1 页 / 共 5 页
字号:





                          17.  MESSAGES


Most error messages have an associated error number.  By looking
up the number in the list below you can obtain additional
information about the cause of the error.  This information is
also available from a self-extracting executable msg.exe, found
on the PC-lint distribution diskette, which produces the
machine-readable ASCII file msg.txt.  For FlexeLint users, the
file msg.txt can be found on the FlexeLint Supplementary
diskette.

Messages numbered  1000 and higher pertain generally to C++.
This is summarized in the table below.

After a possible 1000 is subtracted off, the remainder lies in
the range 0-999.  Remainders in the range 1-199 are syntax
errors, 200-299 are PC-lint/FlexeLint internal errors and should
never occur, 300-399 are fatal errors usually brought about by
exceeding some limit, 400-699 are warning messages that indicate
that something is likely to be wrong with the program being
examined.  Remainders in the range 700-899 designate
informational messages.  These may be errors but they also may
represent legitimate programming practices depending upon
personal programming style.  Remainders in the range 900-999 are
called "Elective Notes".  They are not automatically output.  You
may examine the list to see if you wish to be alerted to any of
them.

		       C               C++         Warning Level

Syntax Errors         1 - 199      1001 - 1199            1
Internal Errors     200 - 299                             0
Fatal Errors        300 - 399                             0
Warnings            400 - 699      1400 - 1699            2
Informational       700 - 899      1700 - 1899            3
Elective Notes      900 - 999      1900 - 1999            4


Glossary

A few of the terms used in the commentary below are:

argument The actual argument of a function as opposed to a dummy
         (or formal) parameter of a function (see parameter).

arithmetic  any of the integral types (see below) plus float,
         double, and long double.

Boolean  In general, the word Boolean refers to quantities that
         can be either true or false.  An expression is said to
         be Boolean (perhaps it would be better to say
         'definitely Boolean') if it is of the form: operand op
         operand where op is a relational (> >= < <=), an
         equality operator (== !=), logical And (&&) or logical
         Or (||).  A context is said to require a Boolean if it
         is used in an if or while clause or if it is the 2nd
         expression of a for clause or if it is an argument to
         one of the operators:  && or ||.  An expression needn't
         be definitely Boolean to be acceptable in a context
         that requires a Boolean.  Any integer or pointer is
         acceptable.

declaration gives properties about an object or function (as
         opposed to a definition).

definition  that which allocates space for an object or function
         (as opposed to a declaration) and which may also
         indicate properties about the object.  There should be
         only one definition for an object but there may be many
         declarations.

integral a type that has properties similar to integers.  These
         include char, short, int, and long and the unsigned
         variations of any of these.

scalar   any of the arithmetic types plus pointers.

lvalue   is an expression that can be used on the Left hand side
         of an assignment operator (=).  Some contexts require
         lvalues such as autoincrement (++) and autodecrement
         (--).

macro    an abbreviation defined by a #define statement.  It may
         or may not have arguments.

member   elements of a struct and of a union are called members.

module   that which is compiled by a compiler in a single
         independent compilation.  It typically includes all the
         text of a .c (or a .cpp or .cxx, etc.) file plus any
         text within any #include file(s).

parameter A formal parameter of a function as opposed to an
         actual argument (see argument).


Message Parameters

Some of the messages are parameterized with one or more of the
following italicized names:

Char     Some character

Context  Specifies one of several contexts in which an
         assignment can be made.  Can be one of:

         o    assignment -- refers to an explicit assignment
              operator.
         o    return -- refers to the implied assignment of a
              return statement. The type of the expression is
              converted implicitly to the type of the function.
         o    initialization -- refers to the assignment
              implied by an initialization statement.
         o    arg. no.... -- refers to the implied assignment
              of an argument in the presence of a prototype.  The
              type of the expression is implicitly converted to the
              type within a prototype.
         o    arg. 'this' -- refers to the implied argument of
              a member function call.


FileName  A filename.  Messages containing this parameter can
          be suppressed with the -efile( ... ) option.

Integer   Some integer

Invocation  A function call with argument types.  To
          suppress a message containing an Invocation you need
          the complete call, not just the function name.  For
          example, the call f(1) could result in Error  1024
          parameterized by 'f(int)'.  To suppress this message
          you could use -esym(1024,f(int)).  You could also use
          wild cards as in -esym(1024,f*).

Kind      A list of control structures.

Location  A line number followed optionally by a filename (if
          different from the current) and/or a module name if
          different from the current.

Name      A string, usually an identifier, that can be
          suppressed with a -esym but not with -elibsym.

String    A sequence of characters identified further in the
          message description.

Symbol    The name of a user identifier referring to a C or C++
          object such as variable, function, structure, etc.
          Messages containing this parameter can be suppressed
          with the -esym( ... ) option.  For C++, if Symbol is
          the name of a function the full function signature
          (including parameters) is given.  Error suppression
          with -esym does not require (nor want) the parameters.

Type      A type or a top type base is provided.  A top type
          base is one of pointer, function, array, struct, union,
          or enum.

TypeDiff  specifies the way in which one type differs from
          another.  Because of type qualification, function
          prototypes, and type compounding, it may not be obvious
          how two types differ.  Also, see the -etd option to
          inhibit errors based on type differences.  TypeDiff can
          be one or more of:

          o    basic -- The two types differ in some
               fundamental way such as double versus int.

          o    count -- Two function types differ in the number
               of arguments.

          o    ellipsis -- Two function types differ in that
               one is prototyped using an ellipsis and the other is
	           not prototyped.  See Section 15.

          o    incomplete -- At least one of the types is only
               partially specified such as an array without a
	           dimension or a function without a prototype.

          o    nominal -- The types are nominally different but
               are otherwise the same.  For example, int versus long
	           where these are the same size or double versus long
               double where these are the same size.  The two types
	           are either both integral or both float or are functions
               that return types or have arguments that differ
	           nominally.  If long is the same size as int then
               unsigned long will differ from int both as nominal and
	           as signed/unsigned.  If not the same size, then the
               difference is precision.

          o    origin -- The types are not actually different
	           but have different origins.  For example a struct is
               defined in two separate modules rather than in one
	           header file.  If for some reason you want to do this
               then use the option -etd(origin).

          o    precision -- Two arithmetic types differ in
	           their precision such as int vs. long where these are
               different sizes.

          o    promotion -- Two function types differ in that
	           one is prototyped with a char, short or float type and
               the other is not prototyped.

          o    ptrs to... -- Pointers point to different types,
	           some TypeDiff code follows.

          o    ptrs to incompatible types -- Pointers point to
	           types, which in turn differ in precision, count, size,
	           ellipsis or promotion.

          o    qualification -- Qualifiers such as const,
	           volatile, etc. are inconsistent.

          o    signed/unsigned -- The types differ in that one
               is a signed integral type and the other is unsigned of
               the same size, or they are both functions that return
               types that differ in this way, or they are both
               pointers to types that differ in this way.

          o    size -- Two arrays differ in array dimension.

          o    strong -- two types differ in that one is strong
	           and the other is not the same strong type.

          o    void/nonvoid -- The two types differ in that one
	           is void and the other is not or, more frequently, they
	           are both functions returning types that differ in this
	           respect or pointers to types that differ in this
	           respect.

          o    enum/enum-- One type is an enum.  The other
               type is a different enum.

          o    int/enum-- One type is an enum and the other is
	           an int.

          o    Type = Type -- The two types in an assignment of
               some kind differ in some basic way and no more
	           information is available.

          o    Type vs. Type -- The two types differ in some
               basic way and no more information is available.



17.1  C Syntax Errors

1     Unclosed Comment (Location)  -- End of file was reached
      with an open comment still unclosed.  The Location of the
      open comment is shown.

2     Unclosed Quote  -- An end of line was reached and a
      matching quote character (single or double) to an earlier
      quote character on the same line was not found.

3     #else without a #if  -- A #else was encountered not in the
      scope of a #if, #ifdef or #ifndef.

4     Too many #if levels  -- An internal limit was reached on
      the level of nesting of #if statements (including #ifdef
      and #ifndef).

5     Too many #endif's  -- A #endif was encountered not in the
      scope of a #if or #ifdef or #ifndef.

6     Stack Overflow  -- One of the built-in non-extendable
      stacks has been overextended.  The possibilities are too
      many nested #if statements, #includes statements
      (including all recursive #include statements), static
      blocks (bounded by braces) or #define replacements.

7     Unable to open include file: FileName  -- FileName is the
      name of the include file, which could not be opened.  See
      also flag fdi (See Section 5.), option -i...  ( See
      Section 5.) and Section 13.2.1 INCLUDE Environment
      Variable.

8     Unclosed #if (Location)  -- A #if (or #ifdef or #ifndef)
      was encountered without a corresponding #endif.  Location
      is the location of the #if.

9     Too many #else's in #if (Location)  -- A given #if
      contained a #else, which in turn was followed by either
      another #else or a #elif.  The error message gives the
      line of the #if statement that started the conditional
      that contained the aberration.

10    Expecting 'String'  -- String is the expected token.  The
      expected token could not be found.  This is commonly given
      when certain reserved words are not recognized.

		int __interrupt f();

      will receive an Expecting ';' message at the f because it
      thinks you just declared __interrupt.  The cure is to
      establish a new reserved word with +rw(__interrupt).
      Also, make sure you are using the correct compiler options

⌨️ 快捷键说明

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