]> andersk Git - splint.git/blobdiff - src/llmain.c
*** empty log message ***
[splint.git] / src / llmain.c
index f09061cbd1598f66d9cc40f6af56dd7626911b45..8340ea3b0df77dbf35d71d393dcdfb41e1b9b18e 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
 ** LCLint - annotation-assisted static program checker
 ** Copyright (C) 1994-2001 University of Virginia,
@@ -93,8 +92,8 @@ static void cleanupFiles (void);
 static void showHelp (void);
 static void interrupt (int p_i);
 
-static void loadrc (/*@open@*/ FILE *p_rcfile, cstringSList *p_passThroughArgs)
-   /*@ensures closed p_rcfile@*/ ;
+static void loadrc (FILE *p_rcfile, cstringSList *p_passThroughArgs)
+     /*@ensures closed p_rcfile@*/ ;
 
 static void describeVars (void);
 static bool specialFlagsHelp (char *p_next);
@@ -487,9 +486,10 @@ static void handlePassThroughFlag (char *arg)
   if (open)
     {
       showHerald ();
-      llerror (FLG_BADFLAG,
-              message ("Unclosed quote in flag: %s",
-                       cstring_fromChars (arg)));
+      voptgenerror (FLG_BADFLAG,
+                   message ("Unclosed quote in flag: %s",
+                            cstring_fromChars (arg)),
+                   g_currentloc);
     }
   else
     {
@@ -929,8 +929,10 @@ int main (int argc, char *argv[])
                  else
                    {
                      DPRINTF (("Error!"));
-                     llgloberror (message ("Unrecognized option: %s", 
-                                           cstring_fromChars (thisarg)));
+                     voptgenerror (FLG_BADFLAG,
+                                   message ("Unrecognized option: %s", 
+                                            cstring_fromChars (thisarg)),
+                                   g_currentloc);
                    }
                }
              else
@@ -2142,8 +2144,8 @@ llexit (int status)
 }
 
 void
-loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs)
-    /*@ensures closed rcfile@*/
+loadrc (/*:open:*/ FILE *rcfile, cstringSList *passThroughArgs)
+   /*@ensures closed rcfile@*/
 {
   char *s = mstring_create (MAX_LINE_LENGTH);
   char *os = s;
@@ -2190,10 +2192,11 @@ loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs)
          else
            {
              showHerald ();
-             llerror (FLG_SYNTAX, 
-                      message ("Bad flag syntax (+ or - expected, "
-                               "+ is assumed): %s", 
-                               cstring_fromChars (s)));
+             voptgenerror (FLG_BADFLAG, 
+                           message ("Bad flag syntax (+ or - expected, "
+                                    "+ is assumed): %s", 
+                                    cstring_fromChars (s)),
+                           g_currentloc);
              s--;
              set = TRUE;
            }
@@ -2267,9 +2270,10 @@ loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs)
                }
              else
                {
-                 llerror (FLG_BADFLAG,
-                          message ("Unrecognized option: %s", 
-                                   cstring_fromChars (thisflag)));
+                 voptgenerror (FLG_BADFLAG,
+                               message ("Unrecognized option: %s", 
+                                        cstring_fromChars (thisflag)),
+                               g_currentloc);
                }
            }
          else
@@ -2281,8 +2285,9 @@ loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs)
                  if (opt == FLG_HELP)
                    {
                      showHerald ();
-                     llerror (FLG_BADFLAG,
-                              message ("Cannot use help in rc files"));
+                     voptgenerror (FLG_BADFLAG,
+                                   message ("Cannot use help in rc files"),
+                                   g_currentloc);
                    }
                  else if (flagcode_isPassThrough (opt)) /* -D or -U */
                    {
@@ -2348,11 +2353,12 @@ loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs)
                      if (cstring_isUndefined (extra))
                        {
                          showHerald ();
-                         llerror 
+                         voptgenerror 
                            (FLG_BADFLAG,
                             message
                             ("Flag %s must be followed by an argument",
-                             flagcode_unparse (opt)));
+                             flagcode_unparse (opt)),
+                            g_currentloc);
                        }
                      else
                        {
@@ -2382,10 +2388,11 @@ loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs)
                              else 
                                {
                                  showHerald ();
-                                 llerror
-                                   (FLG_SYNTAX
+                                 voptgenerror
+                                   (FLG_BADFLAG
                                     message ("Options file not found: %s", 
-                                             extra));
+                                             extra),
+                                    g_currentloc);
                                }
                            }
                          else if (opt == FLG_INIT)
@@ -2416,10 +2423,11 @@ loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs)
                                    }
                                  else
                                    {
-                                     llerror
-                                       (FLG_SYNTAX
+                                     voptgenerror
+                                       (FLG_BADFLAG
                                         message ("Unmatched \" in option string: %s", 
-                                                 extra));
+                                                 extra),
+                                        g_currentloc);
                                    }
                                }
                              
This page took 0.035656 seconds and 4 git commands to generate.