[cfe-dev] null-deref-ps.c patch

Ted Kremenek kremenek at apple.com
Mon Sep 28 16:55:34 PDT 2009


Hi John,

This is great.  I've gone ahead and applied this patch and also  
removed the dependency on stdint.h.

Thanks!
Ted

On Sep 28, 2009, at 4:26 PM, John Thompson wrote:

> Hi,
>
> I'm back to trying to get some of failing Clang unit tests on  
> Windows to pass.
>
> In null-deref-ps.c I'm getting two unexpected warnings.   I'm  
> guessing that since the "assert" on Windows doesn't seem to give an  
> indication of not returning, we are getting the warnings:
>
> FAIL: Clang::Analysis/null-deref-ps.c (43 of 75)
> ******************** TEST 'Clang::Analysis/null-deref-ps.c' FAILED  
> ********************
> Script:
> --
> C:/Tools/llvm/bin/Debug/clang-cc.exe -analyze -std=gnu99 -checker- 
> cfref -verify C:\Tools\llvm\tools\clang\test\Analysis\null-deref- 
> ps.c -ana
> lyzer-constraints=basic -analyzer-store=basic
> C:/Tools/llvm/bin/Debug/clang-cc.exe -analyze -std=gnu99 -checker- 
> cfref -verify C:\Tools\llvm\tools\clang\test\Analysis\null-deref- 
> ps.c -ana
> lyzer-constraints=range -analyzer-store=basic
> C:/Tools/llvm/bin/Debug/clang-cc.exe -analyze -std=gnu99 -checker- 
> cfref -analyzer-store=region -analyzer-constraints=range -analyzer- 
> purge-d
> ead=false -verify C:\Tools\llvm\tools\clang\test\Analysis\null-deref- 
> ps.c
> C:/Tools/llvm/bin/Debug/clang-cc.exe -analyze -std=gnu99 -checker- 
> cfref -analyzer-store=region -analyzer-constraints=range -verify C: 
> \Tools\
> llvm\tools\clang\test\Analysis\null-deref-ps.c
> --
> Exit Code: 1
> Command Output (stdout):
> --
> Command 0: "C:/Tools/llvm/bin/Debug/clang-cc.exe" "-analyze" "- 
> std=gnu99" "-checker-cfref" "-verify" "C:\Tools\llvm\tools\clang\test 
> \Analysi
> s\null-deref-ps.c" "-analyzer-constraints=basic" "-analyzer- 
> store=basic"
> Command 0 Result: 1
> Command 0 Output:
>
> Command 0 Stderr:
> Warnings seen but not expected:
>   Line 193: Dereference of null pointer
>   Line 204: Dereference of null pointer
>
> --
> Command Output (stderr):
> --
> --
> ********************
> The enclosed patch replaces the assert.h include with a stripped- 
> down version of the assert macro.  I've also run the tests on an x86  
> Linux virtual machine to make sure it still works there.  Should it  
> therefore work on all the other platforms too?
>
> -John
>
> -- 
> John Thompson
> John.Thompson.JTSoftware at gmail.com
>
> <nullderefps.patch>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090928/aa92eba4/attachment.html>


More information about the cfe-dev mailing list