From 21f0106ca9c670068f388b5f54fb5a54981b7c15 Mon Sep 17 00:00:00 2001 From: evans1629 Date: Tue, 12 Mar 2002 14:44:33 +0000 Subject: [PATCH] Win32 problems --- src/Makefile.in | 3 ++- src/constraintList.c | 11 ++++++++--- src/flagMarker.c | 2 +- src/llerror.c | 31 +++++++++++++++++++++++++++---- win32/README.1ST | 7 ++++++- winconfig.h | 4 ++-- 6 files changed, 46 insertions(+), 12 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 2cadafc..6e5cc19 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1056,7 +1056,8 @@ splintme: splintsome: ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude lcllib.c -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +partial -/* $(LINTSRC) $(LCLSRC)*/ +# drl changed to use # for comment +#/* $(LINTSRC) $(LCLSRC)*/ splinttest: ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude cpplib.c +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +keep +supcounts +partial -null diff --git a/src/constraintList.c b/src/constraintList.c index e23047c..2ae629e 100644 --- a/src/constraintList.c +++ b/src/constraintList.c @@ -286,10 +286,15 @@ constraintList_print (/*@temp@*/ constraintList s) /*@*/ if (constraint_isDefined(current) ) { cstring temp1; - if ( context_getFlag (FLG_ORCONSTRAINT) ) + + if (context_getFlag (FLG_ORCONSTRAINT)) + { temp1 = constraint_printOr(current); - else - temp1 = constraint_print(current); + } + else + { + temp1 = constraint_print (current); + } type = message ("%q %q\n", type, temp1 ); } diff --git a/src/flagMarker.c b/src/flagMarker.c index 7580bb7..c1327bd 100644 --- a/src/flagMarker.c +++ b/src/flagMarker.c @@ -133,7 +133,7 @@ bool flagMarker_equal (flagMarker f1, flagMarker f2) return (flagcode_equal (f1->code, f2->code)); } - BADBRANCH; + BADBRANCHRET (FALSE); } cstring flagMarker_unparse (flagMarker c) diff --git a/src/llerror.c b/src/llerror.c index 8f8b959..3221841 100644 --- a/src/llerror.c +++ b/src/llerror.c @@ -381,7 +381,7 @@ mstring_split (/*@returned@*/ char **sp, ** ** if there is a newline in first maxline characters, split there ** if line len is <= maxline, return no split - ** if there is a ':' or ';' followed by ' ' in first maxline characters, + ** if there is a ':' or ';' or ',' followed by ' ' in first maxline characters, ** split there unless the ' ' is followed by a '}', then ** split after '}' ** of the ';' is inside quotation marks @@ -421,8 +421,9 @@ mstring_split (/*@returned@*/ char **sp, { int i = 0; char savechar; - char *lcolon, *lsemi, *splitat; - + char *lcolon, *lsemi, *lcomma; + char *splitat; + splitat = NULL; t = s + maxline - 1; @@ -431,6 +432,8 @@ mstring_split (/*@returned@*/ char **sp, *t = '\0'; lcolon = strrchr (s, ':'); lsemi = strrchr (s, ';'); + lcomma = strrchr (s, ','); + *t = savechar; splitat = maxcp (lcolon, lsemi); @@ -438,7 +441,9 @@ mstring_split (/*@returned@*/ char **sp, if (splitat != NULL && ((int)(splitat - s) > MINLINE) && *(splitat) != '\0' && *(splitat + 1) == ' ' - && (*(splitat + 2) != '}' && (*(splitat + 2) != '\0'))) + && (*(splitat + 2) != '}' + && *(splitat + 2) != ',' + && (*(splitat + 2) != '\0'))) { *(splitat + 1) = '\0'; t = splitat + 2; @@ -447,6 +452,24 @@ mstring_split (/*@returned@*/ char **sp, return; } + if (lcomma != NULL && ((lcomma - s) > maxline - 5)) + { + splitat = lcomma; + + if (splitat != NULL && ((int)(splitat - s) > MINLINE) + && *(splitat) != '\0' + && *(splitat + 1) == ' ' + && (*(splitat + 2) != '}' + && (*(splitat + 2) != '\0'))) + { + *(splitat + 1) = '\0'; + t = splitat + 2; + *tp = t; + llassertprotect (*tp == NULL || (*tp > osp)); + return; + } + } + while (*t != ' ' && *t != '\t' && i < MAXSEARCH) { t--; diff --git a/win32/README.1ST b/win32/README.1ST index b39daae..60fe462 100755 --- a/win32/README.1ST +++ b/win32/README.1ST @@ -1,5 +1,5 @@ Spint Version 3.0.1 - 7 January 2002 + 11 March 2002 www.splint.org @@ -12,4 +12,9 @@ platform if you want to modify the Splint sources. This project file has been used to compile Splint using Microsoft Visual C++ 6.0. +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. diff --git a/winconfig.h b/winconfig.h index cd9e68d..3ca7fb2 100644 --- a/winconfig.h +++ b/winconfig.h @@ -22,13 +22,13 @@ #define LCL_COMPILE "Compiled using Microsoft Visual C++ 6.0" /* Splint's version number */ -#define LCL_PARSE_VERSION "Splint 3.0.1.6" +#define LCL_PARSE_VERSION "Splint 3.0.1.7" /* Define to disable support LCL files */ /* #undef NOLCL */ /* Splint's version number and configure/build date */ -#define SPLINT_VERSION "Splint 3.0.1.6 --- 11 Feb 2002" +#define SPLINT_VERSION "Splint 3.0.1.7 --- 11 Mar 2002" /* The system's main include directory */ #define SYSTEM_LIBDIR "C:/include" -- 2.45.1