]> andersk Git - splint.git/blobdiff - src/flags.c
Added support for omitted if clauses in conditionals, patch provided by peteran.
[splint.git] / src / flags.c
index e8b3ceb00f6f8decc50e6550627a3dad85f9cf07..bc1597faf1950d66b478f9fa2fd7837ba96636d0 100644 (file)
@@ -28,9 +28,9 @@
 # include "splintMacros.nf"
 # include "basic.h"
 # include "osd.h"
-# include "portab.h"
 # include "rcfiles.h"
 # include "lslinit.h"
+# include "llmain.h"
 
 /*
 ** from the CC man page:
@@ -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 { 
@@ -1659,9 +1660,16 @@ flags_processFlags (bool inCommandLine,
       if (*thisarg == '-' || *thisarg == '+')
        {
          bool set = (*thisarg == '+');
-         cstring flagname = cstring_fromChars (thisarg + 1); /* skip '-' or '+' */
-         flagcode opt = flags_identifyFlag (flagname);
+         cstring flagname;
+         flagcode opt;
+
+         if (*(thisarg + 1) == '-') { /* allow -- before flags */
+           flagname = cstring_fromChars (thisarg + 2);
+         } else {
+           flagname = cstring_fromChars (thisarg + 1);
+         }
 
+         opt = flags_identifyFlag (flagname);
          DPRINTF (("Flag [%s]: %s", flagname, flagcode_unparse (opt)));
          
          if (flagcode_isInvalid (opt))
This page took 0.030348 seconds and 4 git commands to generate.