I would disagree that static code analysis is not useful for plain C code as opposed to C++. I have used SQLite3 in Visual C++ 2010 with SP1 for Windows x86 compilation using its' static code analysis command line option of /analyze as well as using level 4 compilation (/W4) and there are a number of warnings reported in the sqlite3.c amalgamation file (where the pre-processor value for SQLITE_VERSION is "3.6.12.1"), which I would love to see fixed in the SQLite code base.
FYI here are the reported issues / warnings: 1>------ Rebuild All started: Project: SQLiteDemo, Configuration: Debug Win32 ------ 1> stdafx.cpp 1> sqlite3.c 1>d:\dev\sqlite\sqlite3.c(21016): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(21018): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(21023): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(32371): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'AreFileApisANSI' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(10430) : see declaration of 'AreFileApisANSI' 1>d:\dev\sqlite\sqlite3.c(32394): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'CloseHandle' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5068) : see declaration of 'CloseHandle' 1>d:\dev\sqlite\sqlite3.c(32399): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'CreateFileA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9269) : see declaration of 'CreateFileA' 1>d:\dev\sqlite\sqlite3.c(32408): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'CreateFileW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9282) : see declaration of 'CreateFileW' 1>d:\dev\sqlite\sqlite3.c(32416): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'CreateFileMappingA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(7024) : see declaration of 'CreateFileMappingA' 1>d:\dev\sqlite\sqlite3.c(32422): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'CreateFileMappingW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(7036) : see declaration of 'CreateFileMappingW' 1>d:\dev\sqlite\sqlite3.c(32431): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'CreateMutexW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(6672) : see declaration of 'CreateMutexW' 1>d:\dev\sqlite\sqlite3.c(32440): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'DeleteFileA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9523) : see declaration of 'DeleteFileA' 1>d:\dev\sqlite\sqlite3.c(32448): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'DeleteFileW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9529) : see declaration of 'DeleteFileW' 1>d:\dev\sqlite\sqlite3.c(32473): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'FlushFileBuffers' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4929) : see declaration of 'FlushFileBuffers' 1>d:\dev\sqlite\sqlite3.c(32478): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'FormatMessageA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5687) : see declaration of 'FormatMessageA' 1>d:\dev\sqlite\sqlite3.c(32487): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'FormatMessageW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5699) : see declaration of 'FormatMessageW' 1>d:\dev\sqlite\sqlite3.c(32495): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'FreeLibrary' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(2611) : see declaration of 'FreeLibrary' 1>d:\dev\sqlite\sqlite3.c(32499): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetCurrentProcessId' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3500) : see declaration of 'GetCurrentProcessId' 1>d:\dev\sqlite\sqlite3.c(32504): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetDiskFreeSpaceA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(8981) : see declaration of 'GetDiskFreeSpaceA' 1>d:\dev\sqlite\sqlite3.c(32513): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetDiskFreeSpaceW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(8991) : see declaration of 'GetDiskFreeSpaceW' 1>d:\dev\sqlite\sqlite3.c(32522): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetFileAttributesA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9378) : see declaration of 'GetFileAttributesA' 1>d:\dev\sqlite\sqlite3.c(32530): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetFileAttributesW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9384) : see declaration of 'GetFileAttributesW' 1>d:\dev\sqlite\sqlite3.c(32538): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetFileAttributesExW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9463) : see declaration of 'GetFileAttributesExW' 1>d:\dev\sqlite\sqlite3.c(32546): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetFileSize' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4862) : see declaration of 'GetFileSize' 1>d:\dev\sqlite\sqlite3.c(32551): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetFullPathNameA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9163) : see declaration of 'GetFullPathNameA' 1>d:\dev\sqlite\sqlite3.c(32560): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetFullPathNameW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(9172) : see declaration of 'GetFullPathNameW' 1>d:\dev\sqlite\sqlite3.c(32568): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetLastError' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4255) : see declaration of 'GetLastError' 1>d:\dev\sqlite\sqlite3.c(32578): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetProcAddress' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(2635) : see declaration of 'GetProcAddress' 1>d:\dev\sqlite\sqlite3.c(32584): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetSystemInfo' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5422) : see declaration of 'GetSystemInfo' 1>d:\dev\sqlite\sqlite3.c(32588): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetSystemTime' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5387) : see declaration of 'GetSystemTime' 1>d:\dev\sqlite\sqlite3.c(32593): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetSystemTimeAsFileTime' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5394) : see declaration of 'GetSystemTimeAsFileTime' 1>d:\dev\sqlite\sqlite3.c(32602): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetTempPathA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(8667) : see declaration of 'GetTempPathA' 1>d:\dev\sqlite\sqlite3.c(32610): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetTempPathW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(8674) : see declaration of 'GetTempPathW' 1>d:\dev\sqlite\sqlite3.c(32617): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetTickCount' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5651) : see declaration of 'GetTickCount' 1>d:\dev\sqlite\sqlite3.c(32622): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'GetVersionExA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(13645) : see declaration of 'GetVersionExA' 1>d:\dev\sqlite\sqlite3.c(32630): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'HeapAlloc' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3116) : see declaration of 'HeapAlloc' 1>d:\dev\sqlite\sqlite3.c(32635): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'HeapCreate' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3099) : see declaration of 'HeapCreate' 1>d:\dev\sqlite\sqlite3.c(32640): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'HeapDestroy' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3108) : see declaration of 'HeapDestroy' 1>d:\dev\sqlite\sqlite3.c(32644): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'HeapFree' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3136) : see declaration of 'HeapFree' 1>d:\dev\sqlite\sqlite3.c(32648): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'HeapReAlloc' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3126) : see declaration of 'HeapReAlloc' 1>d:\dev\sqlite\sqlite3.c(32653): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'HeapSize' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3145) : see declaration of 'HeapSize' 1>d:\dev\sqlite\sqlite3.c(32658): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'HeapValidate' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3154) : see declaration of 'HeapValidate' 1>d:\dev\sqlite\sqlite3.c(32664): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'LoadLibraryA' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(7160) : see declaration of 'LoadLibraryA' 1>d:\dev\sqlite\sqlite3.c(32672): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'LoadLibraryW' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(7167) : see declaration of 'LoadLibraryW' 1>d:\dev\sqlite\sqlite3.c(32679): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'LocalFree' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(2832) : see declaration of 'LocalFree' 1>d:\dev\sqlite\sqlite3.c(32684): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'LockFile' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4786) : see declaration of 'LockFile' 1>d:\dev\sqlite\sqlite3.c(32693): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'LockFileEx' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4808) : see declaration of 'LockFileEx' 1>d:\dev\sqlite\sqlite3.c(32701): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'MapViewOfFile' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5875) : see declaration of 'MapViewOfFile' 1>d:\dev\sqlite\sqlite3.c(32706): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'MultiByteToWideChar' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnls.h(1348) : see declaration of 'MultiByteToWideChar' 1>d:\dev\sqlite\sqlite3.c(32711): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'QueryPerformanceCounter' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(13629) : see declaration of 'QueryPerformanceCounter' 1>d:\dev\sqlite\sqlite3.c(32716): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'ReadFile' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4918) : see declaration of 'ReadFile' 1>d:\dev\sqlite\sqlite3.c(32721): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'SetEndOfFile' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4980) : see declaration of 'SetEndOfFile' 1>d:\dev\sqlite\sqlite3.c(32725): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'SetFilePointer' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4987) : see declaration of 'SetFilePointer' 1>d:\dev\sqlite\sqlite3.c(32730): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'Sleep' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4726) : see declaration of 'Sleep' 1>d:\dev\sqlite\sqlite3.c(32734): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'SystemTimeToFileTime' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5592) : see declaration of 'SystemTimeToFileTime' 1>d:\dev\sqlite\sqlite3.c(32740): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'UnlockFile' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4797) : see declaration of 'UnlockFile' 1>d:\dev\sqlite\sqlite3.c(32749): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'UnlockFileEx' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4823) : see declaration of 'UnlockFileEx' 1>d:\dev\sqlite\sqlite3.c(32757): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'UnmapViewOfFile' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(5894) : see declaration of 'UnmapViewOfFile' 1>d:\dev\sqlite\sqlite3.c(32761): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'WideCharToMultiByte' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnls.h(1359) : see declaration of 'WideCharToMultiByte' 1>d:\dev\sqlite\sqlite3.c(32766): warning C4232: nonstandard extension used : 'pCurrent' : address of dllimport 'WriteFile' is not static, identity not guaranteed 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4907) : see declaration of 'WriteFile' 1>d:\dev\sqlite\sqlite3.c(35501): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(35526): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(41320): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(44320): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(44329): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(51510): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(51611): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(55274): warning C4244: '-=' : conversion from 'int' to 'u16', possible loss of data 1>d:\dev\sqlite\sqlite3.c(55625): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(61344): warning C4244: '=' : conversion from 'int' to 'ynVar', possible loss of data 1>d:\dev\sqlite\sqlite3.c(69953): warning C4244: '=' : conversion from 'int' to 'u8', possible loss of data 1>d:\dev\sqlite\sqlite3.c(74394): warning C4244: '=' : conversion from 'int' to 'u16', possible loss of data 1>d:\dev\sqlite\sqlite3.c(75742): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(82217): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(82354): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(82360): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(82378): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(82384): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(83562): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(83724): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(83735): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(84227): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(84622): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(85169): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(90363): warning C4244: 'function' : conversion from 'int' to 'u8', possible loss of data 1>d:\dev\sqlite\sqlite3.c(91313): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(92545): warning C4244: 'return' : conversion from 'int' to 'u8', possible loss of data 1>d:\dev\sqlite\sqlite3.c(93296): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(93296): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(93296): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(93643): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(94157): warning C4244: '=' : conversion from 'int' to 'u8', possible loss of data 1>d:\dev\sqlite\sqlite3.c(94258): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(94288): warning C4127: conditional expression is constant 1>d:\dev\sqlite\sqlite3.c(101556): warning C4244: 'function' : conversion from 'int' to 'u8', possible loss of data 1>d:\dev\sqlite\sqlite3.c(114864): warning C4244: '=' : conversion from 'int' to 'char', possible loss of data 1>d:\dev\sqlite\sqlite3.c(21016): warning C6326: Potential comparison of a constant with another constant 1>d:\dev\sqlite\sqlite3.c(35041): warning C6246: Local declaration of 'p' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '34945' of 'd:\dev\sqlite\sqlite3.c': Lines: 34945 1>d:\dev\sqlite\sqlite3.c(34954): warning C6011: Dereferencing NULL pointer 'p': Lines: 34944, 34945, 34946, 34947, 34949, 34950, 34951, 34952, 34954 1>d:\dev\sqlite\sqlite3.c(35530): warning C6001: Using uninitialized memory 'lastErrno': Lines: 35469, 35470, 35471, 35472, 35473, 35474, 35475, 35478, 35479, 35482, 35484, 35485, 35489, 35490, 35529, 35530 1>d:\dev\sqlite\sqlite3.c(36094): warning C6385: Invalid data: accessing 'p->u.apSub', the readable size is '500' bytes, but '4196' bytes might be read: Lines: 36088, 36089, 36090, 36091, 36092, 36093, 36094 1>d:\dev\sqlite\sqlite3.c(37809): warning C6011: Dereferencing NULL pointer 'pPage': Lines: 37705, 37706, 37707, 37708, 37710, 37711, 37712, 37713, 37714, 37717, 37723, 37740, 37741, 37742, 37743, 37744, 37752, 37753, 37804, 37805, 37808, 37809 1>d:\dev\sqlite\sqlite3.c(41676): warning C6011: Dereferencing NULL pointer 'pList': Lines: 41640, 41641, 41646, 41647, 41655, 41656, 41661, 41662, 41663, 41664, 41670, 41674, 41676 1>d:\dev\sqlite\sqlite3.c(44320): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(51486): warning C6326: Potential comparison of a constant with another constant 1>d:\dev\sqlite\sqlite3.c(54524): warning C6011: Dereferencing NULL pointer 'pTrunk': Lines: 54454, 54455, 54456, 54457, 54458, 54459, 54460, 54462, 54463, 54464, 54465, 54467, 54470, 54472, 54473, 54480, 54496, 54497, 54498, 54505, 54506, 54509, 54512, 54513, 54517, 54521, 54522, 54524 1>d:\dev\sqlite\sqlite3.c(54704): warning C6011: Dereferencing NULL pointer '*ppPage': Lines: 54454, 54455, 54456, 54457, 54458, 54459, 54460, 54462, 54463, 54464, 54465, 54467, 54470, 54472, 54473, 54480, 54496, 54497, 54498, 54505, 54506, 54509, 54512, 54513, 54517, 54521, 54522, 54524, 54525, 54529, 54530, 54531, 54534, 54535, 54536, 54537, 54655, 54656, 54657, 54698, 54700, 54701, 54702, 54703, 54704 1>d:\dev\sqlite\sqlite3.c(55191): warning C6386: Buffer overrun: accessing 'pPage->apOvfl', the writable size is '20' bytes, but '4004' bytes might be written: Lines: 55157, 55158, 55159, 55160, 55161, 55162, 55163, 55164, 55166, 55168, 55170, 55171, 55172, 55173, 55174, 55180, 55181, 55182, 55183, 55184, 55186, 55189, 55190, 55191 1>d:\dev\sqlite\sqlite3.c(55192): warning C6386: Buffer overrun: accessing 'pPage->aiOvfl', the writable size is '10' bytes, but '2002' bytes might be written: Lines: 55157, 55158, 55159, 55160, 55161, 55162, 55163, 55164, 55166, 55168, 55170, 55171, 55172, 55173, 55174, 55180, 55181, 55182, 55183, 55184, 55186, 55189, 55190, 55191, 55192 1>d:\dev\sqlite\sqlite3.c(56156): warning C6385: Invalid data: accessing 'apOld', the readable size is '((i+1))*sizeof(MemPage *)' bytes, but '12' bytes might be read: Lines: 55545, 55546, 55547, 55548, 55549, 55550, 55551, 55552, 55553, 55554, 55555, 55556, 55557, 55558, 55559, 55560, 55561, 55562, 55563, 55564, 55565, 55566, 55567, 55568, 55569, 55570, 55571, 55573, 55574, 55575, 55586, 55587, 55589, 55604, 55605, 55609, 55610, 55612, 55613, 55617, 55619, 55622, 55624, 55625, 55626, 55627, 55631, 55632, 55634, 55640, 55641, 55642, 55656, 55657, 55659, 55660, 55665, 55666, 55669, 55625, 55626, 55627, 55628, 55629, 56153, 56154, 56155, 56156 1>d:\dev\sqlite\sqlite3.c(56086): warning C6385: Invalid data: accessing 'apCopy', the readable size is '12' bytes, but '16' bytes might be read: Lines: 55545, 55546, 55547, 55548, 55549, 55550, 55551, 55552, 55553, 55554, 55555, 55556, 55557, 55558, 55559, 55560, 55561, 55562, 55563, 55564, 55565, 55566, 55567, 55568, 55569, 55570, 55571, 55573, 55574, 55575, 55586, 55587, 55589, 55604, 55605, 55609, 55610, 55612, 55613, 55617, 55619, 55622, 55624, 55625, 55626, 55627, 55631, 55632, 55634, 55640, 55641, 55642, 55656, 55657, 55659, 55660, 55665, 55666, 55669, 55625, 55626, 55627, 55631, 55632, 55634, 55640, 55641, 55642, 55656, 55657, 55659, 55660, 55665, 55666, 55669, 55625, 55626, 55627, 55631, 55632, 55675, 55680, 55681, 55686, 55687, 55691, 55692, 55693, 55711, 55712, 55713, 55714, 55720, 55721, 55722, 55723, 55725, 55726, 55734, 55735, 55736, 55737, 55744, 55745, 55746, 55747, 55748, 55749, 55750, 55751, 55752, 55753, 55754, 55755, 55756, 55757, 55758, 55759, 55762, 55770, 55713, 55714, 55720, 55721, 55722, 55723, 55725, 55726, 55734, 55735, 55736, 55737, 55744, 55745, 55746, 55747, 55748, 55749, 55750, 55751, 55752, 55753, 55754, 55755, 55756, 55757, 55758, 55759, 55762, 55770, 55713, 55714, 55720, 55721, 55722, 55723, 55725, 55726, 55734, 55735, 55736, 55737, 55744, 55713, 55790, 55791, 55792, 55793, 55794, 55791, 55792, 55793, 55794, 55791, 55803, 55804, 55805, 55817, 55859, 55863, 55864, 55865, 55866, 55867, 55868, 55869, 55870, 55871, 55864, 55891, 55892, 55893, 55894, 55895, 55896, 55891, 55892, 55893, 55894, 55895, 55896, 55891, 55913, 55936, 55937, 55943, 55944, 55946, 55947, 55948, 55949, 55950, 55951, 55953, 55958, 55959, 55944, 56011, 56012, 56013, 56014, 56019, 56040, 56072, 56073, 56074, 56075, 56076, 56077, 56078, 56079, 56080, 56081, 56085, 56086 1>d:\dev\sqlite\sqlite3.c(73173): warning C6011: Dereferencing NULL pointer 'pChunk': Lines: 73148, 73149, 73150, 73151, 73152, 73155, 73157, 73158, 73159, 73160, 73169, 73171, 73172, 73173 1>d:\dev\sqlite\sqlite3.c(73835): warning C6011: Dereferencing NULL pointer 'pTopNC': Lines: 73623, 73624, 73625, 73626, 73627, 73628, 73629, 73630, 73631, 73633, 73634, 73635, 73638, 73639, 73643, 73814, 73824, 73825, 73826, 73827, 73828, 73834, 73835 1>d:\dev\sqlite\sqlite3.c(76200): warning C6011: Dereferencing NULL pointer 'p': Lines: 76176, 76177, 76178, 76179, 76180, 76182, 76188, 76189, 76190, 76191, 76192, 76193, 76194, 76196, 76197, 76198, 76199, 76200 1>d:\dev\sqlite\sqlite3.c(77311): warning C6011: Dereferencing NULL pointer 'pFarg': Lines: 77007, 77008, 77009, 77010, 77011, 77012, 77013, 77015, 77016, 77021, 77024, 77026, 77274, 77275, 77276, 77277, 77278, 77279, 77280, 77281, 77282, 77283, 77284, 77286, 77289, 77292, 77294, 77295, 77296, 77297, 77298, 77299, 77308, 77309, 77310, 77311 1>d:\dev\sqlite\sqlite3.c(80986): warning C6385: Invalid data: accessing 'db->aDb', the readable size is 'sizeof((db->aDb[0]))*2' bytes, but '3216' bytes might be read: Lines: 80840, 80841, 80842, 80843, 80844, 80845, 80846, 80847, 80848, 80849, 80850, 80852, 80854, 80855, 80856, 80857, 80865, 80871, 80875, 80876, 80877, 80878, 80875, 80876, 80877, 80878, 80875, 80876, 80877, 80878, 80875, 80887, 80888, 80889, 80890, 80895, 80896, 80897, 80903, 80904, 80905, 80911, 80912, 80913, 80914, 80915, 80916, 80919, 80934, 80935, 80936, 80978, 80983, 80984, 80985, 80986 1>d:\dev\sqlite\sqlite3.c(82216): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(82216): warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant 1>d:\dev\sqlite\sqlite3.c(82354): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(82360): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(82378): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(82384): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(83724): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(83735): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(84227): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(84475): warning C6011: Dereferencing NULL pointer 'pName': Lines: 84079, 84080, 84081, 84082, 84083, 84084, 84085, 84086, 84087, 84088, 84089, 84090, 84091, 84092, 84093, 84094, 84095, 84097, 84098, 84099, 84102, 84109, 84145, 84146, 84147, 84148, 84149, 84151, 84153, 84154, 84156, 84161, 84167, 84186, 84209, 84210, 84211, 84212, 84213, 84222, 84223, 84226, 84227, 84228, 84238, 84250, 84265, 84266, 84267, 84276, 84279, 84280, 84281, 84283, 84284, 84285, 84286, 84287, 84288, 84289, 84290, 84291, 84292, 84293, 84294, 84295, 84299, 84302, 84315, 84358, 84360, 84382, 84383, 84423, 84456, 84457, 84458, 84460, 84461, 84466, 84467, 84472, 84473, 84475 1>d:\dev\sqlite\sqlite3.c(84622): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(85169): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(89308): warning C6011: Dereferencing NULL pointer 'pStep': Lines: 89144, 89145, 89146, 89147, 89149, 89150, 89152, 89153, 89154, 89155, 89156, 89157, 89158, 89159, 89160, 89161, 89162, 89163, 89165, 89166, 89168, 89237, 89239, 89240, 89242, 89262, 89263, 89265, 89270, 89286, 89288, 89289, 89290, 89291, 89292, 89296, 89298, 89307, 89308 1>d:\dev\sqlite\sqlite3.c(89311): warning C6011: Dereferencing NULL pointer 'pTrigger': Lines: 89144, 89145, 89146, 89147, 89149, 89150, 89152, 89153, 89154, 89155, 89156, 89157, 89158, 89159, 89160, 89161, 89162, 89163, 89165, 89166, 89168, 89237, 89239, 89240, 89242, 89262, 89263, 89265, 89270, 89286, 89288, 89289, 89290, 89291, 89292, 89296, 89298, 89307, 89308, 89310, 89311 1>d:\dev\sqlite\sqlite3.c(91216): warning C6011: Dereferencing NULL pointer 'pSrcIdx': Lines: 91010, 91011, 91012, 91013, 91014, 91015, 91016, 91017, 91018, 91019, 91020, 91021, 91022, 91023, 91024, 91026, 91029, 91033, 91037, 91041, 91042, 91045, 91048, 91051, 91056, 91059, 91062, 91063, 91066, 91069, 91070, 91071, 91074, 91075, 91083, 91084, 91085, 91088, 91092, 91096, 91099, 91102, 91105, 91106, 91109, 91112, 91105, 91106, 91109, 91112, 91105, 91106, 91109, 91112, 91105, 91116, 91117, 91120, 91121, 91123, 91116, 91128, 91140, 91144, 91155, 91156, 91157, 91158, 91159, 91160, 91161, 91164, 91180, 91181, 91182, 91186, 91187, 91188, 91189, 91190, 91191, 91192, 91193, 91195, 91196, 91203, 91204, 91205, 91206, 91207, 91208, 91209, 91210, 91209, 91212, 91213, 91214, 91215, 91216 1>d:\dev\sqlite\sqlite3.c(92787): warning C6385: Invalid data: accessing 'azModeName', the readable size is '24' bytes, but '36' bytes might be read: Lines: 92772, 92778, 92779, 92780, 92781, 92782, 92783, 92784, 92786, 92787 1>d:\dev\sqlite\sqlite3.c(93294): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(93293): warning C6326: Potential comparison of a constant with another constant 1>d:\dev\sqlite\sqlite3.c(93294): warning C6326: Potential comparison of a constant with another constant 1>d:\dev\sqlite\sqlite3.c(93295): warning C6326: Potential comparison of a constant with another constant 1>d:\dev\sqlite\sqlite3.c(94258): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(94288): warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator? 1>d:\dev\sqlite\sqlite3.c(98581): warning C6011: Dereferencing NULL pointer 'pList': Lines: 98548, 98549, 98550, 98551, 98552, 98553, 98555, 98556, 98557, 98558, 98559, 98560, 98561, 98562, 98563, 98564, 98565, 98566, 98571, 98576, 98577, 98578, 98579, 98580, 98581 1>d:\dev\sqlite\sqlite3.c(102882): warning C6385: Invalid data: accessing 'sqlite3UpperToLower', the readable size is '256' bytes, but '1001' bytes might be read: Lines: 102853, 102854, 102855, 102856, 102857, 102858, 102859, 102860, 102861, 102865, 102866, 102867, 102868, 102869, 102870, 102871, 102872, 102873, 102874, 102879, 102880, 102881, 102882 1>d:\dev\sqlite\sqlite3.c(105174): warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and. Use an equality test to check for zero-valued flags 1>d:\dev\sqlite\sqlite3.c(105225): warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and. Use an equality test to check for zero-valued flags 1>d:\dev\sqlite\sqlite3.c(108029): warning C6295: Ill-defined for-loop: 'unsigned __int64' values are always of range '0' to '18446744073709551615'. Loop executes infinitely 1>d:\dev\sqlite\sqlite3.c(107865): warning C6011: Dereferencing NULL pointer 'pTabItem->pTab': Lines: 107626, 107627, 107628, 107629, 107630, 107631, 107632, 107633, 107634, 107635, 107636, 107637, 107638, 107644, 107654, 107663, 107664, 107665, 107670, 107675, 107676, 107677, 107678, 107679, 107680, 107681, 107682, 107686, 107691, 107692, 107693, 107694, 107699, 107725, 107726, 107727, 107729, 107726, 107727, 107729, 107726, 107727, 107729, 107726, 107750, 107751, 107759, 107779, 107780, 107782, 107783, 107784, 107785, 107786, 107787, 107788, 107789, 107790, 107792, 107793, 107839, 107840, 107841, 107842, 107843, 107844, 107845, 107846, 107847, 107849, 107850, 107851, 107852, 107856, 107857, 107858, 107859, 107863, 107865 1>d:\dev\sqlite\sqlite3.c(115241): warning C6011: Dereferencing NULL pointer 'db': Lines: 114997, 114998, 114999, 115000, 115001, 115003, 115005, 115006, 115019, 115020, 115021, 115025, 115027, 115029, 115030, 115036, 115037, 115051, 115066, 115067, 115229, 115230, 115231, 115235, 115236, 115237, 115240, 115241 1>d:\dev\sqlite\sqlite3.c(35205): warning C4706: assignment within conditional expression 1>d:\dev\sqlite\sqlite3.c(35531): warning C4701: potentially uninitialized local variable 'lastErrno' used 1>d:\dev\sqlite\sqlite3.c(35566): warning C4706: assignment within conditional expression 1>d:\dev\sqlite\sqlite3.c(35580): warning C4701: potentially uninitialized local variable 'lastErrno' used 1>d:\dev\sqlite\sqlite3.c(102586): warning C4706: assignment within conditional expression 1> SQLiteDemo.cpp 1> need to implement support for std::advance 1> SQLiteDemo10.vcxproj -> D:\Dev\My Code\SQLiteWrappers\.\Debug\SQLiteDemo.exe ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== Is there any way I can help to address / eliminate these issues. Some of these may be false positives which you can eliminate through the use of something like the following: #ifdef _MSC_VER __analysis_assume(somevalue != NULL); #endif Regards, PJ Naughter [Visual C++ MVP] Naughter Software Ltd Mail: pjna at naughter.com Web: www.naughter.com Hotmail/MSN Messenger: pjnaughter at hotmail.com -----Original Message----- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: 06 July 2012 23:35 To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite Provenance On 6 Jul 2012, at 11:24pm, Gavin T Watt <gw...@raytheon.com> wrote: > BTW, do you know if the SQLite team runs any kind of static code > analysis on the source? SQLite is plain C code. Note even C++. So static code analysis is tricky and not likely to be much use. However, Clang static analysis has been applied and it's the last item you can find in the long list of tests listed on this page: <http://www.sqlite.org/testing.html> What is more useful than static code analysis is testing with corrupted database files, with boundary value tests and with valgrind. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users