[llvm-branch-commits] [cfe-branch] r197225 - Improve the 3.4 release notes about the static analyzer new features

Richard Smith richard at metafoo.co.uk
Fri Dec 13 11:47:39 PST 2013


On Fri, Dec 13, 2013 at 3:30 AM, Sylvestre Ledru <sylvestre at debian.org>wrote:

> Author: sylvestre
> Date: Fri Dec 13 05:30:23 2013
> New Revision: 197225
>
> URL: http://llvm.org/viewvc/llvm-project?rev=197225&view=rev
> Log:
> Improve the 3.4 release notes about the static analyzer new features
>
> Modified:
>     cfe/branches/release_34/docs/ReleaseNotes.rst
>
> Modified: cfe/branches/release_34/docs/ReleaseNotes.rst
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/docs/ReleaseNotes.rst?rev=197225&r1=197224&r2=197225&view=diff
>
> ==============================================================================
> --- cfe/branches/release_34/docs/ReleaseNotes.rst (original)
> +++ cfe/branches/release_34/docs/ReleaseNotes.rst Fri Dec 13 05:30:23 2013
> @@ -69,7 +69,7 @@ about them. The improvements since the 3
>  - Boolean increment, a deprecated feature, has own warning flag
>    -Wdeprecated-increment-bool, and is still part of -Wdeprecated.
>  - Clang errors on builtin enum increments and decrements.
> -- -Wloop-analysis now warns on for-loops which have the same increment or
> +- -Wloop-analysis now warns on for-loops which have the same increment or
>    decrement in the loop header as the last statement in the loop.
>  - -Wuninitialized now performs checking across field initializers to
> detect
>    when one field in used uninitialized in another field initialization.
> @@ -189,9 +189,48 @@ Static Analyzer
>  ---------------
>
>  The static analyzer (which contains additional code checking beyond
> compiler
> -warnings) has improved significantly in both in the core analysis engine
> and
> +warnings) has improved significantly in both in the core analysis engine
> and
>  also in the kinds of issues it can find.
>
> +For example, the static analyzer now manages the following cases:
> +
> +- Missing return after function pointer null check.
>

Looks like this would be better described as "calling a function pointer
that is known to be null"?


> +
> +.. code-block:: c
> +
> +  void foo(void (*f)(void)) {
> +    if (f)
> +        return;
> +    f();
> +  }
> +
> +- Detect when ``delete`` is used on an uninitialized variable.
> +
> +.. code-block:: c++
> +
> +  void foo() {
> +    int *x;
> +    delete[] x;
> +  }
> +
> +- Handle destructors for the argument to C++ ``delete``.
> +
> +.. code-block:: c++
> +
> +  class DerefClass{
> +  public:
> +    int *x;
> +    DerefClass() {}
> +    ~DerefClass() {*x = 1;}
> +  };
> +
> +  void testDoubleDeleteClassInstance() {
> +    DerefClass *foo = new DerefClass();
> +    delete foo;
> +    delete foo;
>

Did you mean to include a double-deletion here?


> +  }
> +
> +
>  Clang Format
>  ------------
>
>
>
> _______________________________________________
> llvm-branch-commits mailing list
> llvm-branch-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-branch-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-branch-commits/attachments/20131213/b3806589/attachment.html>


More information about the llvm-branch-commits mailing list