
PClint常见告警整理_20150710.xls
109页错误说明 C(编号) C++(编号)语法错误 1-199 1001-1199内部错误 200-299致命错误 300-399告警(Warning) 400-699 1400-1699消息(Info.) 700-899 1700-1899可选信息(Elective Notes) 900-999 1900-1999-w0 不产生信息(除了遇到致命的错误)-w1 只生成错误信息 没有告警信息和其它提示信息-w2 只有错误和告警信息-w3 生成错误、告警和其它提示信息(这是默认设置)-w4 生成所有信息简要说明指的是一般编译器也会产生的语法错误是PC-Lint程序内部的错误,这类错误不会出现在代码中的指的是由于内存限制等导致的系统致命错误出现的提示信息,是根据隐藏代码问题的可能性进行分类的:其中编号400-699指的是被检查代码中很可能存在问题而产生的告警信息;这些编号中出现的信息,产生错误的可能性相比告警信息来说级别要低,但仍然可能是因为代码问题导致的问题可选信息,他们不会被默认检查,除非你在选项中指定检查他们w0 不产生信息(除了遇到致命的错误)-w1 只生成错误信息 没有告警信息和其它提示信息-w2 只有错误和告警信息-w3 生成错误、告警和其它提示信息(这是默认设置)-w4 生成所有信息告警等级100234-w0 不产生信息(除了遇到致命的错误)-w1 只生成错误信息 没有告警信息和其它提示信息-w2 只有错误和告警信息-w3 生成错误、告警和其它提示信息(这是默认设置)-w4 生成所有信息编号40config.cpp413415420423429433504506520521522525527529530533534539545550564568569572573578603605603,605613616644650661668673685701702708713714715716717725731734 7377407447477527627667737747757857867947967978018188258268278341065140114111501150915111512154015511554155517071722173217331735173817401746176217631768177317741776177817861788规则说明Undeclared identifier 'Name' -- Within an expression, an identifier wasencountered that had not previously been declared and was not followed by a leftparenthesis. Name is the name of the identifier.可能使用空指针Likely use of null pointer 'Symbol' in [left/right] argument tooperator 'String' ReferenceLikely Access of out-of-bounds pointer访问越界访问超出范围的内存Apparent access beyond array for function 'Symbol', argumentInteger exceeds Integer Reference -- This message is issued for severallibrary functions (such as fwrite, memcmp, etc.) wherein there is an apparentattemptto access more data than exist. For example, if the length of data specified inthefwrite call exceeds the size of the data specified. The function is specified bySymboland the arguments are identified by argument number. See also Section 11.1Function在变量' Symbol'赋值时出现内存泄漏分配给一个指针变量,这个指针变量保留有一个分配的目标的地址,还没有释放。
指针存储空间未释放或返回Custodial pointer 'Symbol' (Location) has not been freed orreturned -- A pointer of auto storage class was allocated storage, which wasneitherfreed nor returned to the caller. This represents a "memory leak". A pointer isconsidered custodial if it uniquely points to the storage area. It is notconsideredcustodial if it has been copied. Thus:int *p = new int[20]; // p is a custodial pointerint *q = p; // p is no longer custodialp = new int[20]; // p again becomes custodialq = p + 0; // p remains custodialHere p does not lose its custodial property by merely participating in anarithmeticoperation.A pointer can lose its custodial property by passing the pointer to a function.If theparameter of the function is typed pointer to const or if the function is alibraryfunction, that assumption is not made. For examplep = malloc(10);strcpy (p, "hello");为指针分配的空间不够Allocated area not large enough for pointer -- An allocation wasassigned to a pointer whose reach extends beyond the area that was allocated.Thiswould usually happen only with library allocation routines such as malloc andcalloc. For example:int *p = malloc(1);This message is also provided for user-declared allocation functions. Forexample, if auser's own allocation function is provided with the following semantic:-sem(ouralloc,@P==malloc(1n))We would report the same message. Please note that it is necessary to designatethat the异常的移位固定的Boolean值Constant value Boolean -- A Boolean, i.e., a quantity found in a context thatrequires a Boolean such as an argument to && or || or an if() or while() clauseor !,was found to be a constant and hence will evaluate the same way each time.for循环的第一个表达式Highest String ’Name’ lacks side-effects -- The first expression of a forclause should either be one of the privileged operators: assignment,increment,decrement or a call to an impure function or one modifying itsargument(s). See Warning 522.for循环的第三个表达式Highest String ’Name’ lacks side-effects -- The third expression of a forclause should either be one of the privileged operators: assignment,increment,decrement or a call to an impure function or one modifying itsargument(s). See Warning 522.指针自加Highest String ’Name’ lacks side-effects -- If a statement consists only ofan expression, it should either be one of the privileged operators: assignment,increment,decrement or a call to an impure function or one modifying its argument(s). Forexample, if operator * is the built-in operator, the statement *p++; draws thismessage with String equal to operator and Name equal to *. But note that p++;does not. This is because the highest operator in the former case is '*' whichhas no side effects whereas p++ does. It is possible for a function to have noside-effects. Such a function is called pure. See the discussion of the puresemantic in Section 11.2.1. For example:void f() { int n = 3; n++; }void g() { f(); }will trigger this message with String in the message equal to function and Nameequal to f.The definition o。
