]> andersk Git - splint.git/blobdiff - src/context.c
Removed .lh .lcs .lcd files in test directory from distribution tar ball as suggested...
[splint.git] / src / context.c
index 4037e4d18941eb55969a55bcc1d00bf3a876e459..6d521cb73629c2c17a2f1e9abd36d75525090757 100644 (file)
 # include "splintMacros.nf"
 # include "llbasic.h"
 
-# ifndef NOLCL
 # include "usymtab_interface.h"
-# endif
-
 # include "exprChecks.h"
 # include "filelocStack.h"
-# include "fileIdList.h"
 # include "llmain.h"
 # include "intSet.h"
 # include "osd.h"
@@ -54,7 +50,7 @@ extern /*@external@*/ int mtdebug;
 typedef struct
 { 
   cstring file; 
-  typeIdSet daccess 
+  typeIdSet daccess; 
 } maccesst;
 
 typedef enum { 
@@ -477,14 +473,12 @@ context_exitMTfile (void)
   gc.kind = CX_GLOBAL;
 }
 
-# ifndef NOLCL
 void
 context_enterLCLfile (void)
 {
   gc.kind = CX_LCL;
   gc.facct = typeIdSet_emptySet ();
 }
-# endif
 
 static void
 addModuleAccess (/*@only@*/ cstring fname, typeIdSet mods)
@@ -541,7 +535,6 @@ insertModuleAccess (cstring fname, typeId t)
     addModuleAccess (cstring_copy (fname), typeIdSet_single (t));
 }
 
-# ifndef NOLCL
 void
 context_exitLCLfile (void)
 {
@@ -558,7 +551,6 @@ context_exitLCLfile (void)
   gc.kind = CX_GLOBAL;
   gc.facct = typeIdSet_emptySet ();
 }
-# endif
 
 void
 context_dumpModuleAccess (FILE *fout)
@@ -928,7 +920,7 @@ context_resetAllFlags (void)
    */
 
   /* commenting ou until some output issues are fixed */
-  /* gc.flags[FLG_ORCONSTRAINT] = TRUE;*/
+  gc.flags[FLG_ORCONSTRAINT] = TRUE; 
   
   gc.flags[FLG_CONSTRAINTLOCATION] = TRUE;
 
@@ -936,11 +928,12 @@ context_resetAllFlags (void)
   gc.flags[FLG_WARNSYSFILES] = TRUE;
 
   /*
-  ** On by default for Win32, but not Unix (to support MS/VC++ error message format).
+  ** On by default for Win32, but not Unix
   */
 
 # ifdef WIN32
   gc.flags[FLG_PARENFILEFORMAT] = TRUE;
+  gc.flags[FLG_CASEINSENSITIVEFILENAMES] = TRUE;
 # endif
 }
 
@@ -1047,7 +1040,7 @@ context_setModeAux (cstring s, bool warn)
          FLG_TYPEUNUSED,
          FLG_CONSTUNUSED, FLG_ENUMMEMUNUSED, FLG_FIELDUNUSED,
          FLG_PTRNUMCOMPARE, FLG_BOOLCOMPARE, FLG_UNSIGNEDCOMPARE,
-         FLG_MUTREP, FLG_NOEFFECT, FLG_IMPTYPE,
+         FLG_MUTREP, FLG_NOEFFECT, FLG_IMPTYPE, 
          FLG_RETVALOTHER, FLG_RETVALBOOL, FLG_RETVALINT,
          FLG_SPECUNDEF, FLG_INCONDEFS, FLG_INCONDEFSLIB, FLG_MISPLACEDSHAREQUAL,
          FLG_MATCHFIELDS,
@@ -2897,6 +2890,20 @@ context_setString (flagcode flag, cstring val)
 
   switch (flag)
     {
+      /*
+    case FLG_BOOLTRUE:
+      usymtab_supGlobalEntry 
+       (uentry_makeConstantValue (val, ctype_bool, 
+                                  fileloc_getBuiltin (), TRUE, 
+                                  multiVal_makeInt (1)));
+      break;
+    case FLG_BOOLFALSE:
+      usymtab_supGlobalEntry 
+       (uentry_makeConstantValue (val, ctype_bool, 
+                                  fileloc_getBuiltin (), FALSE, 
+                                  multiVal_makeInt (0)));
+      break;
+      */
     case FLG_MESSAGESTREAM:
     case FLG_WARNINGSTREAM:
     case FLG_ERRORSTREAM:
@@ -3009,13 +3016,13 @@ context_setString (flagcode flag, cstring val)
       {
        ; /* Okay not handle everything in this switch */
       }
-    }
+  /*@i523@*/ } /* evans 2002-03-24: splintme reports a spurious (I think) warning here...need to look into it */
   
   if (cstring_length (val) >= 1
       && cstring_firstChar (val) == '\"')
     {
       llerror_flagWarning (message
-                          ("setting %s to string beginning with \".  You probably "
+                          ("Setting %s to string beginning with \".  You probably "
                            "don't meant to have the \"'s.",
                            flagcode_unparse (flag)));
     }
@@ -3110,7 +3117,6 @@ void context_initMod (void)
   end_allFlagCodes ;
   
   usymtab_initMod ();
-
   context_resetAllFlags ();
 
   assertSet (gc.flags); /* Can't use global in defines */
@@ -3691,7 +3697,9 @@ context_inFunctionName (void)
 void
 context_userSetFlag (flagcode f, bool b)
 {
-  DPRINTF (("set flag: %s", flagcode_unparse (f)));
+  DPRINTF (("set flag: %s / %s", 
+           flagcode_unparse (f),
+           bool_unparse (context_getFlag (f))));
 
   if (f == FLG_NEVERINCLUDE && b)
     {
@@ -3699,7 +3707,7 @@ context_userSetFlag (flagcode f, bool b)
        {
          llerror_flagWarning 
            (cstring_makeLiteral
-            ("setting +neverinclude after +exportheader.  "
+            ("Setting +neverinclude after +exportheader.  "
              "Turning off exportheader, since headers are not checked "
              "when +neverinclude is used."));
 
@@ -3714,7 +3722,7 @@ context_userSetFlag (flagcode f, bool b)
            {
              llerror_flagWarning
                (cstring_makeLiteral
-                ("setting +exportheader after +neverinclude.  "
+                ("Setting +exportheader after +neverinclude.  "
                  "Not setting exportheader, since headers are not checked "
                  "when +neverinclude is used."));
              gc.flags[FLG_EXPORTHEADER] = FALSE;
@@ -3733,7 +3741,7 @@ context_userSetFlag (flagcode f, bool b)
          && !flagcode_hasArgument (f))
        {
          llerror_flagWarning 
-           (message ("setting %s%s redundant with current value", 
+           (message ("Setting %s%s redundant with current value", 
                      cstring_makeLiteralTemp (b ? "+" : "-"),
                      flagcode_unparse (f)));
        }
@@ -3744,7 +3752,7 @@ context_userSetFlag (flagcode f, bool b)
       if (!context_getFlag (FLG_WARNUSE))
        {
          llerror_flagWarning
-           (message ("flag +%s is canceled by -warnuse",
+           (message ("Flag +%s is canceled by -warnuse",
                      flagcode_unparse (f)));
        }
     }
@@ -3756,7 +3764,7 @@ context_userSetFlag (flagcode f, bool b)
          && gc.library != f)
        {
          llerror_flagWarning 
-           (message ("selecting library %s after library %s was "
+           (message ("Selecting library %s after library %s was "
                      "selected (only one library may be used)",
                      flagcode_unparse (f),
                      flagcode_unparse (gc.library)));
@@ -3768,7 +3776,7 @@ context_userSetFlag (flagcode f, bool b)
            {
              llerror_flagWarning
                (cstring_makeLiteral
-                ("selecting unix library.  Unix library is "
+                ("Selecting unix library.  Unix library is "
                  "ad hoc addition to POSIX library.  Recommend "
                  "use +posixlib to select POSIX library instead. "
                  "Use -warnunixlib to suppress this message."));
@@ -3782,7 +3790,7 @@ context_userSetFlag (flagcode f, bool b)
     {
       llerror_flagWarning
        (message
-        ("setting +%s will not produce warnings with -namechecks. "
+        ("Setting +%s will not produce warnings with -namechecks. "
          "Must set +namechecks also.",
          flagcode_unparse (f)));
     }
@@ -4315,17 +4323,29 @@ void
 context_destroyMod (void) 
    /*@globals killed gc@*/
 {
+  int i;
   setCodePoint ();
   ctype_destroyMod ();
+  /*
   setCodePoint ();
   usymtab_free ();
   setCodePoint ();
+  */
+
   fileTable_free (gc.ftab);
+  gc.ftab = fileTable_undefined;
+
   filelocStack_free (gc.locstack);
   setCodePoint ();
-  gc.ftab = fileTable_undefined;
 
   macrocache_free (gc.mc);
+
+  /* evans 2002-07-12: not reported because of reldef */
+  for (i = 0; i < gc.nmods; i++)
+    {
+      cstring_free (gc.moduleaccess[i].file);
+    }
+
   sfree (gc.moduleaccess);
   setCodePoint ();
 
@@ -4346,6 +4366,8 @@ context_destroyMod (void)
   globSet_free (gc.globs_used);
   metaStateTable_free (gc.stateTable);
   annotationTable_free (gc.annotTable);
+
+  
 }
 
 /*
@@ -4377,12 +4399,10 @@ bool context_msgStrictOps (void)
   return gc.flags [FLG_STRICTOPS];
 }
 
-# ifndef NOLCL
 bool context_msgLh (void)           
 {
   return gc.flags [FLG_DOLH];
 }
-# endif
 
 void context_pushLoc (void) 
 {
@@ -4442,12 +4462,10 @@ int context_getExpect (void)
   return (context_getValue (FLG_EXPECT));
 }
 
-# ifndef NOLCL
 int context_getLCLExpect (void)
 {
   return (context_getValue (FLG_LCLEXPECT));
 }
-# endif
 
 int context_getLimit (void)
 {
@@ -4549,7 +4567,6 @@ cstring context_getMerge (void)
   return context_getString (FLG_MERGE);
 }
 
-# ifndef NOLCL
 bool context_inLCLLib (void)
 {   
   return (gc.kind == CX_LCLLIB);
@@ -4569,7 +4586,6 @@ void context_leaveImport (void)
 { 
   gc.inimport = FALSE;
 }
-# endif
 
 bool context_inMacro (void) 
 {
@@ -4598,7 +4614,6 @@ int context_getSpecLinesProcessed (void)
   return (gc.speclinesprocessed);
 }
 
-# ifndef NOLCL
 void context_processedSpecLine (void)
 {
   gc.speclinesprocessed++;
@@ -4607,8 +4622,8 @@ void context_processedSpecLine (void)
 void context_resetSpecLines (void)    
 {
   gc.speclinesprocessed = 0;
+
 }
-# endif
 
 bool context_inGlobalContext (void)
 {
@@ -4896,12 +4911,15 @@ 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  setGlobalStructInfo(ctype ct, constraintList list)
 {
-  int i;
+  /* int i;
   uentryList f;
 
   f =  ctype_getFields (ct);
@@ -4913,7 +4931,7 @@ void  setGlobalStructInfo(ctype ct, constraintList list)
 
       globalStructInfo.ngetUe = 0;
       
-      / *abstraction violation fix it * /
+      /abstraction violation fix it * /
       globalStructInfo.t   = dmalloc(f->nelements * sizeof(struct getUe) );
 
       globalStructInfo.ngetUe = f->nelements;
@@ -4932,11 +4950,12 @@ void  setGlobalStructInfo(ctype ct, constraintList list)
        }
       end_uentryList_elements;
     }
+  */
 }
 
-*/
+/*
 
-bool hasInvariants (ctype ct) /*@*/
+bool hasInvariants (ctype ct) /*@* /
 {
   if ( ctype_sameName(globalStructInfo.ct, ct) )
 
@@ -4947,3 +4966,8 @@ bool hasInvariants (ctype ct) /*@*/
     return FALSE;
   
 }
+
+
+*/
+
+/*@=paramuse@*/
This page took 0.065175 seconds and 4 git commands to generate.