Hi,
Here is a patch that sets the /analyze compiler switch which enables the vs2015
static analysis output. I have tested it with vs2015 community edition and the
latest source distribution of fossil 1.36.
START
--- C:/Users/kev/Downloads/fossil-src-1.361/fossil-1.36/win/Makefile.msc Mon
Oct 24 15:59:33 2016
+++ C:/Users/kev/Downloads/fossil-src-1.36/fossil-1.36/win/Makefile.msc Sat
Oct 29 14:26:46 2016
@@ -34,6 +34,11 @@
DEBUG = 0
!endif
+# Enable analysis?
+!ifndef ANALYZE
+ANALYZE = 0
+!endif
+
# Build the OpenSSL libraries?
!ifndef FOSSIL_BUILD_SSL
FOSSIL_BUILD_SSL = 0
@@ -241,6 +246,10 @@
LDFLAGS = $(LDFLAGS) /DEBUG
!else
CFLAGS = $(CFLAGS) $(CRTFLAGS) /O2
+!endif
+
+!if $(ANALYZE)!=0
+CFLAGS = $(CFLAGS) /analyze
!endif
BCC = $(CC) $(CFLAGS)
END
use it like this:
buildmsvc ANALYZE=1
The piped output is too large to attach here.
I think it's worth checking these. My experience with other projects has shown
that sometimes it's a bit over sensitive but it has also found some real
problems.
A few lines taken from the output:
c:\users\kev\downloads\fossil-src-1.36\fossil-1.36\src\timeline.c(762) :
warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to
64-bit value. Results might not be an expected value.
c:\users\kev\downloads\fossil-src-1.36\fossil-1.36\src\allrepo.c(323) : warning
C6246: Local declaration of 'rc' hides declaration of the same name in outer
scope. For additional information, see previous declaration at line '178' of
'c:\users\kev\downloads\fossil-src-1.36\fossil-1.36\src\allrepo.c'.: Lines: 178
c:\users\kev\downloads\fossil-src-1.36\fossil-1.36\src\delta.c(465) : warning
C6385: Reading invalid data from 'collide': the readable size is
'_Old_5`nHash*sizeof(int)' bytes, but '8' bytes may be read.: Lines: 350, 351,
352, 353, 354, 355, 356, 360, 361, 367, 380, 381, 382, 383, 384, 385, 386, 387,
388, 385, 386, 387, 388, 385, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403,
405, 407, 408, 424, 425, 426, 427, 431, 432, 433, 434, 435, 437, 441, 444, 447,
448, 449, 454, 455, 465
c:\users\kev\downloads\fossil-src-1.36\fossil-1.36\src\dispatch.c(505) :
warning C6011: Dereferencing NULL pointer 'z'. : Lines: 448, 449, 450, 451,
452, 453, 454, 464, 468, 472, 476, 480, 481, 485, 486, 488, 489, 494, 500, 501,
502, 505
Best Wishes,
Kevin
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users