clause inclause;
int numerrors;
+ int numbugs;
filelocStack locstack;
fileTable ftab;
gc.flags[FLG_NULLINIT] = TRUE;
gc.flags[FLG_STRINGLITTOOLONG] = TRUE;
-
+ gc.flags[FLG_MACROCONSTDIST] = TRUE;
gc.flags[FLG_LIKELYBOOL] = TRUE;
gc.flags[FLG_ZEROPTR] = TRUE;
gc.flags[FLG_NUMLITERAL] = TRUE;
gc.flags[FLG_DUPLICATEQUALS] = TRUE;
gc.flags[FLG_SKIPISOHEADERS] = TRUE;
- gc.flags[FLG_SKIPPOSIXHEADERS] = TRUE;
+ gc.flags[FLG_SKIPPOSIXHEADERS] = FALSE;
gc.flags[FLG_SYSTEMDIREXPAND] = TRUE;
gc.flags[FLG_UNRECOGCOMMENTS] = TRUE;
gc.flags[FLG_UNRECOGFLAGCOMMENTS] = TRUE;
** On by default for Win32, but not Unix
*/
-# ifdef WIN32
+# if defined (WIN32) || defined (OS2)
gc.flags[FLG_PARENFILEFORMAT] = TRUE;
gc.flags[FLG_CASEINSENSITIVEFILENAMES] = TRUE;
# endif
FLG_CHECKSTRICTGLOBALS, FLG_IMPCHECKEDSPECGLOBALS,
FLG_MACROMATCHNAME, FLG_WARNLINTCOMMENTS,
FLG_INCLUDENEST, FLG_ISORESERVED, FLG_CPPNAMES,
- FLG_NOPARAMS, FLG_IFEMPTY, FLG_WHILEEMPTY, FLG_REALCOMPARE,
+ FLG_NOPARAMS, FLG_IFEMPTY, FLG_WHILEEMPTY, FLG_REALCOMPARE, FLG_REALRELATECOMPARE,
FLG_BOOLOPS, FLG_SHIFTNEGATIVE,
FLG_SHIFTIMPLEMENTATION,
FLG_BUFFEROVERFLOWHIGH, FLG_BUFFEROVERFLOW,
FLG_FOREMPTY, FLG_WHILEEMPTY,
FLG_IFEMPTY, FLG_IFBLOCK,
FLG_ELSEIFCOMPLETE,
- FLG_REALCOMPARE, FLG_BOOLOPS,
+ FLG_REALCOMPARE, FLG_BOOLOPS, FLG_REALRELATECOMPARE,
FLG_SYSTEMDIRERRORS, FLG_UNUSEDSPECIAL,
FLG_SHIFTNEGATIVE,
void context_enterAndClause (exprNode e)
{
-
+ DPRINTF (("enter and clause: %s", exprNode_unparse (e)));
usymtab_trueBranch (guardSet_copy (exprNode_getGuards (e)));
pushClause (ANDCLAUSE);
}
gc.numerrors = 0;
}
+void
+context_recordBug (void)
+{
+ gc.numbugs++;
+}
+
+int
+context_numBugs (void)
+{
+ return gc.numbugs;
+}
+
void context_initMod (void)
/*@globals undef gc; @*/
{
gc.instandardlib = FALSE;
gc.numerrors = 0;
+ gc.numbugs = 0;
gc.neednl = FALSE;
gc.linesprocessed = 0;
gc.speclinesprocessed = 0;
}
}
-
-/*drl 12/30/01 these are some ugly functions that were added to facilitate struct annotations */
-
-
-/*drl added */
-static ctype lastStruct;
-
-ctype context_setLastStruct (/*@returned@*/ ctype s) /*@globals lastStruct@*/
-{
- lastStruct = s;
- return s;
-}
-
-ctype context_getLastStruct (/*@returned@*/ /*ctype s*/) /*@globals lastStruct@*/
-{
- return lastStruct;
-}
-
-/*
-** Why is this stuff in context.c?
-*/
-
-/*@unused@*/ static int sInfoNum = 0;
-
-
-struct getUe {
- /*@unused@*/ uentry ue;
- /*@unused@*/ sRef s;
-};
-
-struct sInfo {
- /*@unused@*/ ctype ct;
- /*@unused@*/ constraintList inv;
- /*@unused@*/ int ngetUe;
- /*@unused@*/ struct getUe * t ;
-};
-
-/* unused: static struct sInfo globalStructInfo; */
-
-/*drl 1/6/2001: I didn't think these functions were solid enough to include in the
- stable release of splint. I coomented them out so that they won't break anything
- but didn't delete them because they will be fixed and included later
-
-
-*/
-
-/*@-paramuse@*/
-
-void context_setGlobalStructInfo (ctype ct, constraintList list)
+constraintList context_getImplicitFcnConstraints (uentry ue)
{
-# if 0
- /* int i;
- uentryList f;
+ constraintList ret = constraintList_makeNew ();
+ uentryList params = uentry_getParams (ue);
- f = ctype_getFields (ct);
-
- if (constraintList_isDefined(list) )
+ uentryList_elements (params, el)
{
- globalStructInfo.ct = ct;
- globalStructInfo.inv = list;
-
- globalStructInfo.ngetUe = 0;
+ DPRINTF (("setImplicitfcnConstraints doing: %s", uentry_unparse(el)));
- /* abstraction violation fix it * /
- globalStructInfo.t = dmalloc(f->nelements * sizeof(struct getUe) );
-
- globalStructInfo.ngetUe = f->nelements;
-
- i = 0;
-
- uentryList_elements(f, ue)
+ if (uentry_isElipsisMarker (el))
{
- globalStructInfo.t[i].ue = ue;
- globalStructInfo.t[i].s = uentry_getSref(ue);
- TPRINTF(( message(" setGlobalStructInfo:: adding ue=%s and sRef=%s",
- uentry_unparse(ue), sRef_unparse( uentry_getSref(ue) )
- )
- ));
- i++;
+ ;
}
- end_uentryList_elements;
- }
- */
-# endif
-}
-
-# if 0
-/*
-
-bool hasInvariants (ctype ct) /*@* /
-{
- if ( ctype_sameName(globalStructInfo.ct, ct) )
+ else
+ {
+ sRef s = uentry_getSref (el);
+
+ DPRINTF (("Trying: %s", sRef_unparse (s)));
- return TRUE;
+ if (ctype_isPointer (sRef_getType (s)))
+ {
+ constraint c = constraint_makeSRefWriteSafeInt (s, 0);
+ ret = constraintList_add (ret, c);
+
+ /*drl 10/23/2002 added support for out*/
+
+ if (!uentry_isOut(el))
+ {
+ c = constraint_makeSRefReadSafeInt (s, 0);
+ ret = constraintList_add (ret , c);
+ }
+ }
+ else
+ {
+ DPRINTF (("%s is NOT a pointer", sRef_unparseFull (s)));
+ }
+ }
+ } end_uentryList_elements;
- else
-
- return FALSE;
-
+ DPRINTF (("Returns ==> %s", constraintList_unparse (ret)));
+ return ret;
}
-*/
-# endif
-
-/*@=paramuse@*/
-
-
-