]> andersk Git - splint.git/blobdiff - src/context.c
Fixed branch state bug with definitely null values (reported by Jon Wilson).
[splint.git] / src / context.c
index 4344a3f006286512456044fe2dc9aaa36d806c31..7cc5c82a2526e397b1c2c7d4dbb1f3eeeb584a1e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-** LCLint - annotation-assisted static program checker
+** Splint - annotation-assisted static program checker
 ** Copyright (C) 1994-2001 University of Virginia,
 **         Massachusetts Institute of Technology
 **
@@ -19,7 +19,7 @@
 **
 ** For information on lclint: lclint-request@cs.virginia.edu
 ** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
+** For more information: http://www.splint.org
 */
 /*
 ** context.c
@@ -824,6 +824,11 @@ context_resetAllFlags (void)
   gc.flags[FLG_NESTCOMMENT] = TRUE;
   gc.flags[FLG_GLOBALS] = TRUE;
   gc.flags[FLG_FULLINITBLOCK] = TRUE;
+  gc.flags[FLG_INITSIZE] = TRUE;
+  gc.flags[FLG_INITALLELEMENTS] = TRUE;
+
+  gc.flags[FLG_STRINGLITTOOLONG] = TRUE;
+
   gc.flags[FLG_LIKELYBOOL] = TRUE;
   gc.flags[FLG_ZEROPTR] = TRUE;
   gc.flags[FLG_NUMLITERAL] = TRUE;
@@ -860,6 +865,7 @@ context_resetAllFlags (void)
   gc.flags[FLG_FORMATTYPE] = TRUE;
   gc.flags[FLG_BADFLAG] = TRUE;
   gc.flags[FLG_WARNFLAGS] = TRUE;
+  gc.flags[FLG_WARNRC] = TRUE;
   gc.flags[FLG_FILEEXTENSIONS] = TRUE;
   gc.flags[FLG_WARNUNIXLIB] = TRUE;
   gc.flags[FLG_WARNPOSIX] = TRUE;
@@ -972,6 +978,7 @@ context_setMode (cstring s)
       flagcode modeflags[] = 
        {
          FLG_ENUMINT, FLG_MACROMATCHNAME,
+         FLG_STRINGLITNOROOM,
          FLG_MACROUNDEF, FLG_RELAXQUALS, 
          FLG_USEALLGLOBS, FLG_CHECKSTRICTGLOBALS,
          FLG_CHECKSTRICTGLOBALIAS,
@@ -1084,6 +1091,8 @@ context_setMode (cstring s)
          FLG_CHECKMODGLOBALIAS,
          FLG_UNCHECKEDGLOBALIAS,
          FLG_FORMATCONST,
+         FLG_STRINGLITNOROOM,
+         FLG_STRINGLITSMALLER,
           FLG_EXITARG, FLG_PTRNUMCOMPARE, 
          FLG_BOOLCOMPARE, FLG_UNSIGNEDCOMPARE, 
          FLG_MACROUNDEF, FLG_MUSTMOD, FLG_ALLGLOBALS,
@@ -1175,6 +1184,8 @@ context_setMode (cstring s)
          FLG_MODFILESYSTEM,
          FLG_MACROMATCHNAME,
          FLG_FORMATCONST,
+         FLG_STRINGLITNOROOM,
+         FLG_STRINGLITSMALLER,
          FLG_STATETRANSFER, FLG_STATEMERGE,
           FLG_MACROUNDEF, FLG_MUTREP, FLG_MUSTMOD,
          FLG_ALLGLOBALS, FLG_IMPTYPE,
@@ -2847,7 +2858,7 @@ context_setString (flagcode flag, cstring val)
     }
 
   if (cstring_length (val) >= 1
-      && cstring_firstChar (val) == '"')
+      && cstring_firstChar (val) == '\"')
     {
       llerror_flagWarning (message
                       ("setting %s to string beginning with \".  You probably "
@@ -4422,8 +4433,15 @@ void context_checkGlobalScope (void)
 {
   if (gc.kind != CX_GLOBAL)
     {
-      llcontbug (message ("Not in global scope as expected: %q", context_unparse ()));
-      context_quietExitScopes ();
+      if (context_inMacro ())
+       {
+         ; /* evans 2001-10-14: Okay to be in a macro here! */ 
+       }
+      else
+       {
+         llcontbug (message ("Not in global scope as expected: %q", context_unparse ()));
+         context_quietExitScopes ();
+       }
     }
 }
 
This page took 0.034506 seconds and 4 git commands to generate.