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

John Thompson john.thompson.jtsoftware at gmail.com
Mon Sep 28 16:26:34 PDT 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090928/35d9d828/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nullderefps.patch
Type: application/octet-stream
Size: 707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090928/35d9d828/attachment.obj>


More information about the cfe-dev mailing list