From: evans1629 Date: Mon, 21 Apr 2003 01:52:30 +0000 (+0000) Subject: Fixes for win32 X-Git-Tag: splint-3_1_0~6 X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/commitdiff_plain/51bc6ecce8b6e9877dccd8bda2cf220b47e6929c Fixes for win32 --- diff --git a/src/Makefile.am b/src/Makefile.am index 1cc81f3..317310d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -384,6 +384,10 @@ nocheck: test: ${MAKE} ; cd ../test; ${MAKE} --no-print-directory +.PHONY: libs +libs: + ${MAKE} ; cd ../lib; ${MAKE} --no-print-directory + ### Automake generates wrong tags .PHONY: etags etags: diff --git a/src/Makefile.in b/src/Makefile.in index caa0c44..a7663b8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1112,6 +1112,10 @@ nocheck: test: ${MAKE} ; cd ../test; ${MAKE} --no-print-directory +.PHONY: libs +libs: + ${MAKE} ; cd ../lib; ${MAKE} --no-print-directory + ### Automake generates wrong tags .PHONY: etags etags: @@ -1120,7 +1124,7 @@ etags: lintnew: splintme splintme: - ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(OVERFLOWCHSRC) $(LINTSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw + ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(OVERFLOWCHSRC) $(LINTSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw splintmesupcounts: ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(OVERFLOWCHSRC) $(LINTSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -incondefs -exportlocal -supcounts -constuse -mts file -mts filerw diff --git a/src/exprChecks.c b/src/exprChecks.c index 9bc78f2..ae0ed4f 100644 --- a/src/exprChecks.c +++ b/src/exprChecks.c @@ -264,7 +264,7 @@ checkRefGlobParam (sRef base, /*@notnull@*/ exprNode e, else if (sRef_isAnyParam (base)) { uentryList params = context_getParams (); - int paramno = usymId_toInt (sRef_getParam (base)); + int paramno = sRef_getParam (base); if (paramno < uentryList_size (params)) { @@ -319,7 +319,7 @@ checkRefGlobParam (sRef base, /*@notnull@*/ exprNode e, else if (sRef_isAnyParam (base) && !(sRef_isOnly (base))) { uentryList params = context_getParams (); - int paramno = usymId_toInt (sRef_getParam (base)); + int paramno = sRef_getParam (base); if (paramno < uentryList_size (params)) { diff --git a/src/exprNode.c b/src/exprNode.c index 9df0718..578469a 100644 --- a/src/exprNode.c +++ b/src/exprNode.c @@ -3133,7 +3133,7 @@ checkGlobMods (/*@notnull@*/ /*@dependent@*/ exprNode f, if (sRef_isObserver (b)) { - exprNode e = exprNodeList_nth (args, usymId_toInt (sRef_getParam (rb))); + exprNode e = exprNodeList_nth (args, sRef_getParam (rb)); if (optgenerror (FLG_MODOBSERVER, diff --git a/src/flags.c b/src/flags.c index a148f56..58063c8 100644 --- a/src/flags.c +++ b/src/flags.c @@ -128,6 +128,11 @@ typedef enum { ARG_SPECIAL /* ? */ } argcode; +# ifdef WIN32 +/* Make Microsoft VC++ happy */ +# pragma warning (disable:4715) +# endif + static /*@observer@*/ cstring argcode_unparse (argcode arg) { switch (arg) @@ -143,14 +148,10 @@ static /*@observer@*/ cstring argcode_unparse (argcode arg) case ARG_SPECIAL: BADBRANCH; } -# ifdef WIN32 -/* Make Microsoft VC++ happy */ -# pragma warning (disable:4715) -# endif } # ifdef WIN32 -/* # pragma warning (enable:4715) */ +# pragma warning (default : 4715) # endif typedef struct { diff --git a/src/genericTable.c b/src/genericTable.c index 5e1b2a3..75067f6 100644 --- a/src/genericTable.c +++ b/src/genericTable.c @@ -140,19 +140,22 @@ static /*@null@*/ /*@exposed@*/ void *ghbucket_lookup (ghbucket p_h, cstring p_k static void ghbucket_add (/*@notnull@*/ ghbucket h, /*@only@*/ ghentry e) { - void *exloc = ghbucket_lookup (h, e->key); - - if (exloc != NULL) { - llassert (FALSE); - } - - if (h->nspace == 0) { - ghbucket_grow (h); - } - - h->entries[h->size] = e; - h->size++; - h->nspace--; + void *exloc = ghbucket_lookup (h, e->key); + + if (exloc != NULL) { + llcontbug (message ("ghbucket_add: adding duplicate entry: %s", + e->key)); + ghentry_free (e); + return; + } + + if (h->nspace == 0) { + ghbucket_grow (h); + } + + h->entries[h->size] = e; + h->size++; + h->nspace--; } static int diff --git a/src/sRef.c b/src/sRef.c index 7eb9d63..b750436 100644 --- a/src/sRef.c +++ b/src/sRef.c @@ -1076,13 +1076,13 @@ sRef_getUentry (sRef s) } } -usymId +int sRef_getParam (sRef s) { llassert (sRef_isReasonable (s)); llassert (s->kind == SK_PARAM); - return usymId_fromInt (s->info->paramno); + return s->info->paramno; } bool diff --git a/src/scanline.c b/src/scanline.c index 1c539b1..5b0baa8 100644 --- a/src/scanline.c +++ b/src/scanline.c @@ -51,8 +51,9 @@ /*@notfunction@*/ # define MOVECHAR() do { *bufptr++ = c; c = *currentLine++; colNumber++; } while (FALSE) -/*@constant static int MAXCHAR;@*/ -# define MAXCHAR 512 +/* evans 2003-04-21: changed name to avoid conflict with MS VC++ */ +/*@constant static int SCANMAXCHAR;@*/ +# define SCANMAXCHAR 512 /*@constant static int TABSIZE;@*/ # define TABSIZE 8 @@ -66,7 +67,7 @@ static int startCol; static bool reportEOL; static bool reportComments; -static char tokenBuffer[MAXCHAR]; +static char tokenBuffer[SCANMAXCHAR]; static const charClassData charClassDef[] = { diff --git a/src/uentry.c b/src/uentry.c index d951a30..711b32b 100644 --- a/src/uentry.c +++ b/src/uentry.c @@ -5772,6 +5772,11 @@ uentry_getGlobs (uentry l) } } +# ifdef WIN32 +/* Make Microsoft VC++ happy */ +# pragma warning (disable : 4715) +# endif + /*@observer@*/ sRefSet uentry_getMods (uentry l) { @@ -5799,10 +5804,6 @@ uentry_getMods (uentry l) { BADBRANCH; } -# ifdef WIN32 -/* Make Microsoft VC++ happy */ -# pragma warning (disable : 4715) -# endif } ekind diff --git a/win32/README.1ST b/win32/README.1ST index 60fe462..bf0cd26 100755 --- a/win32/README.1ST +++ b/win32/README.1ST @@ -1,5 +1,5 @@ - Spint Version 3.0.1 - 11 March 2002 + Spint Version 3.1.0 + 21 April 2003 www.splint.org @@ -9,12 +9,15 @@ pre-compiled Win32 binary (available from http://www.splint.org) instead of building a Win32 binary from the source code, and using a Unix platform if you want to modify the Splint sources. -This project file has been used to compile Splint using Microsoft Visual -C++ 6.0. +This project file has been used to compile Splint using Microsoft +Visual.Net Framework 1.0, Visual C++ .NET version 7.0.9466. We are not +Windows development experts --- this file hard codes include paths and +other system specific information, so it will not work for you without +some effort. The file cscanner.c generated by flex uses #include -which does not exist in Win32 (at least VC++ 6.0) and is not required by -ISO C99. Line 98 of cscanner.c must be removed to build on Windows. +which does not exist in Win32 (at least VC++ 7.0). That line must be +removed to build on Windows. diff --git a/winconfig.h b/winconfig.h index 3ca7fb2..d424d5c 100644 --- a/winconfig.h +++ b/winconfig.h @@ -4,10 +4,10 @@ /*@-constmacros@*/ /* The directory where Splint's library files live */ -#define DEFAULT_LARCHPATH ".;C:/splint-3.0.1.6/lib" +#define DEFAULT_LARCHPATH ".;C:/splint/lib" /* Splint's imports directory */ -#define DEFAULT_LCLIMPORTDIR ".;C:/splint-3.0.1.6/imports" +#define DEFAULT_LCLIMPORTDIR ".;C:/splint/imports" /* system include directory */ #define GCC_INCLUDE_DIR "C:/include" @@ -16,19 +16,19 @@ #define GCC_INCLUDE_DIR2 "C:/local/include" #define TARGET_CPU "x86" -#define UNAME "WIN32" +#define UNAME "WIN32" /* String describing who compiled this binary and how */ -#define LCL_COMPILE "Compiled using Microsoft Visual C++ 6.0" +#define LCL_COMPILE "Compiled using Microsoft Visual C++ 7.0" /* Splint's version number */ -#define LCL_PARSE_VERSION "Splint 3.0.1.7" +#define LCL_PARSE_VERSION "Splint 3.1.0" /* Define to disable support LCL files */ /* #undef NOLCL */ /* Splint's version number and configure/build date */ -#define SPLINT_VERSION "Splint 3.0.1.7 --- 11 Mar 2002" +#define SPLINT_VERSION "Splint 3.1.0 --- 20 Apr 2003" /* The system's main include directory */ #define SYSTEM_LIBDIR "C:/include"