From b4e45295a8e0c49c249250f13d9d81f2f6b8a00c Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Sat, 6 Oct 2012 17:14:39 +0000 Subject: [PATCH] Clang static analyzer docs: fix a couple of HTML markup issues and non-UTF-8 characters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165364 91177308-0d34-0410-b5e6-96231b3b80d8 --- www/analyzer/available_checks.html | 1 + www/analyzer/potential_checkers.html | 88 ++++++++++++++-------------- 2 files changed, 45 insertions(+), 44 deletions(-) diff --git a/www/analyzer/available_checks.html b/www/analyzer/available_checks.html index 3a902a3d36..12d836c483 100644 --- a/www/analyzer/available_checks.html +++ b/www/analyzer/available_checks.html @@ -127,6 +127,7 @@ osx.coreFoundation.CFRetainReleaseCheck for null arguments to CFRetain/CFRelease. + osx.coreFoundation.containers.OutOfBoundsChecks for index out-of-bounds when using 'CFArray' API. diff --git a/www/analyzer/potential_checkers.html b/www/analyzer/potential_checkers.html index 85155c095c..a2d637548a 100644 --- a/www/analyzer/potential_checkers.html +++ b/www/analyzer/potential_checkers.html @@ -18,7 +18,7 @@

List of potential checkers

- +

allocation/deallocation

@@ -176,7 +176,7 @@ void test() {
memory.NegativeArraySize
enhancement to experimental.security.MallocOverflow
(C, C++)


-‘n’ is used to specify the buffer size may be negative +'n' is used to specify the buffer size may be negative
 #include <stdlib.h>
 
@@ -189,7 +189,7 @@ void test() {
 
 
- +

constructors/destructors

@@ -223,7 +223,7 @@ class A {
- +

exceptions

@@ -260,7 +260,7 @@ void f() throw(int) {
- +

smart pointers

@@ -286,7 +286,7 @@ void test() {
- +

undefined behavior

@@ -432,7 +432,7 @@ void test() { B *b1 = new B; B b2; new (b1) T; - new (&b2) T; + new (&b2) T; delete b1; // warn } // warn @@ -485,7 +485,7 @@ void test() { *iq = 1; // warn const Y y; - Y* p = const_cast<Y*>(&y); + Y* p = const_cast<Y*>(&y); p->x.i = 1; // ok p->x.j = 1; // warn } @@ -544,10 +544,10 @@ struct non_POD : public POD { extern POD pod; extern non_POD non_pod; -int *p1 = &non_pod.j; // warn -int *p2 = &non_pod.pod.i; // warn -int *p3 = &pod.i; // ok -POD *p4 = & non_pod; // warn +int *p1 = &non_pod.j; // warn +int *p2 = &non_pod.pod.i; // warn +int *p3 = &pod.i; // ok +POD *p4 = &non_pod; // warn POD a; non_POD b; @@ -555,7 +555,7 @@ non_POD b; struct S { int *k; non_POD non_pod; - S() : k(&non_pod.j) {} // warn + S() : k(&non_pod.j) {} // warn }; // C++11 @@ -572,10 +572,10 @@ struct non_trivial: public trivial { extern trivial t; extern non_trivial nt; -int *p1 = &nt.j; // warn -int *p2 = &nt.i; // warn -int *p3 = &t.i; // ok -trivial *p4 = &nt; +int *p1 = &nt.j; // warn +int *p2 = &nt.i; // warn +int *p3 = &t.i; // ok +trivial *p4 = &nt; trivial t; non_trivial nt; @@ -583,7 +583,7 @@ non_trivial nt; struct S { int *k; non_trivial nt; - S() : k(&nt.j) {} // warn + S() : k(&nt.j) {} // warn }; @@ -820,12 +820,12 @@ The effects are undefined if an exception is thrown.
 struct S {
   int i, j;
-  S (const S &s) {
+  S (const S &s) {
     i = s.i;
     throw 1; // warn
     j = s.j;
   };
-  S& operator=(const S &s) {
+  S &operator=(const S &s) {
     i = s.i;
     throw 1; // warn
     j = s.j;
@@ -993,8 +993,8 @@ class my_streambuf : public std::streambuf {
 
 void test() {
   std::filebuf fb;
-  std::istream in(&fb);
-  std::ostream out(&fb);
+  std::istream in(&fb);
+  std::ostream out(&fb);
   std::filebuf::off_type pos(-1);
   in.seekg(pos); // warn
   out.seekp(-1); // warn
@@ -1002,7 +1002,7 @@ void test() {
 
- +

different

@@ -1175,8 +1175,8 @@ void test() { @@ -1290,14 +1290,14 @@ The expression always evaluates to true/false void test() { int i=0; if (i!=0) {}; // warn - if (i==0 && i==1) {}; // warn + if (i==0 && i==1) {}; // warn if (i<0 || i>=0) {}; // warn }
different.WrongVarForStmt
(C, C++)


-Possibly wrong variable is used in the loop/cond-expression of the ‘for’ -statement. Did you mean ‘proper_variable_name’? +Possibly wrong variable is used in the loop/cond-expression of the 'for' +statement. Did you mean 'proper_variable_name'?
 void test() {
   int i;
@@ -1213,21 +1213,21 @@ void test() {
 
 
different.BitwiseOpBoolArg
maybe join with experimental.core.BoolAssignment
(C, C++)


-bool value is used at the left/right part of the & (|) operator. Did you mean -&& (||) ? +bool value is used at the left/right part of the & (|) operator. Did you mean +&& (||) ?
 int f();
 
 void test() {
   bool b = true;
-  if (b & f()) {} // warn
+  if (b & f()) {} // warn
 }
 
different.LabelInsideSwitch
(C)


Possible misprint: label found inside the switch() statement. (* did you mean -‘default’?) +'default'?)
 void test() {
   int c = 7;
@@ -1242,7 +1242,7 @@ void test() {
 
 
different.IdenticalCondIfIf
(C)


-The conditions of two subsequent ‘if’ statements are identical +The conditions of two subsequent 'if' statements are identical
 void test() {
   int c = 7;
@@ -1255,7 +1255,7 @@ void test() {
 
 
different.CondOpIdenticalReturn
(C)


-The return expressions of the ‘?:’ operator are identical +The return expressions of the '?:' operator are identical
 void test() {
   unsigned a;
@@ -1265,7 +1265,7 @@ void test() {
 
 
different.UnaryPlusWithUnsigned
(C)


-Using ‘unary +’ with unsigned is meaningless +Using 'unary +' with unsigned is meaningless
 void test() {
   unsigned a;
@@ -1275,11 +1275,11 @@ void test() {
 
 
different.LogicalOpUselessArg
(C)


-The second operand of the && operator has no impact on expression result +The second operand of the && operator has no impact on expression result
 void test() {
   unsigned a;
-  if (a<7 && a<10) {}; // warn
+  if (a<7 && a<10) {}; // warn
 }
 
different.SameResUnsignedCmp
(C)


-Comparison of unsigned expression ‘op expr’ is always true/false +Comparison of unsigned expression 'op expr' is always true/false
 void test() {
   unsigned u;
@@ -1309,7 +1309,7 @@ void test() {
 
different.OpPrecedenceAssignCmp
(C)


Comparison operation has higher precedence then assignment. Bool value is -assigned to variable of type ‘type’. Parenthesis may bee required around an +assigned to variable of type 'type'. Parenthesis may bee required around an assignment
 int f();
@@ -1339,7 +1339,7 @@ void test() {
 
(C++)

The object was created but is not being used

The exception object was created but is not being used. Did you mean -‘throw std::exception();’ ? +'throw std::exception();'?
 #include <exception>
 
@@ -1374,7 +1374,7 @@ void test() {
 
 
different.ConversionToBool
maybe join with experimental.core.BoolAssignment
(C, C++)


-Odd implicit conversion from ‘type’ to ‘bool’ +Odd implicit conversion from 'type' to 'bool'
 bool test() {
   return 1.; // warn
@@ -1488,7 +1488,7 @@ public:
 
 
- +

WinAPI

@@ -1507,7 +1507,7 @@ void test() { BOOL fSuccess; fSuccess = CreateProcess( NULL, TEXT("MyProgram.exe"), NULL, NULL, - TRUE, 0, NULL, NULL, &si, &pi); + TRUE, 0, NULL, NULL, &si, &pi); } // warn @@ -1548,7 +1548,7 @@ void test()
- +

optimization

@@ -1593,14 +1593,14 @@ variable void test() { const char* s = "abc"; - if (strlen(s) > 0 && + if (strlen(s) > 0 && strlen(s) < 7) {}; // warn }
optimization.EmptyCstrDetect
(C)


-Optimization: it is more efficient to use “str[0] != ‘\0’” to identify an empty +Optimization: it is more efficient to use "str[0] != '\0'" to identify an empty string
 #include <string.h>