]> 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 b9874fe18e1290c8f01b07f45262effbeaaeb334..bc1597faf1950d66b478f9fa2fd7837ba96636d0 100644 (file)
@@ -28,7 +28,6 @@
 # include "splintMacros.nf"
 # include "basic.h"
 # include "osd.h"
-# include "portab.h"
 # include "rcfiles.h"
 # include "lslinit.h"
 # include "llmain.h"
@@ -129,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) 
@@ -144,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 { 
@@ -1660,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.931573 seconds and 4 git commands to generate.