]> andersk Git - splint.git/blobdiff - src/cscanner.l
Merged this branch with the one in the splint.sf.net repository.
[splint.git] / src / cscanner.l
index 1a8e618a50db271bf45852a896f3ef8fb8391de3..0d05b48b4c8c456b1ca66b678f49976b0f2d6635 100644 (file)
@@ -84,6 +84,8 @@ ULSuffix                ({U}{L}|{L}{U})
 
 # include "cgrammar.h"
 # include "cgrammar_tokens.h"
+
+# include "fileIdList.h"
 # include "portab.h"
 
 static bool lastWasString = FALSE;
@@ -269,7 +271,6 @@ static void setTokLengthT (size_t len)
 
 "volatile"     { setTokLength (8); RETURN_TOK (QVOLATILE); }
 "const"                { setTokLength (5); RETURN_TOK (QCONST); }
-"restrict"     { setTokLength (8); RETURN_TOK (QRESTRICT); }
 
                         /* some systems expect this! [gack!] */ 
 "__const"      { setTokLength (7); RETURN_TOK (QCONST); }
@@ -2048,30 +2049,33 @@ static int handleLlSpecial ()
                {
                  ;
                }
-             else if (flagcode_isModeName (fflag))
+             else if (flagcode_isInvalid (fflag))
                {
-                 if (ynm_isMaybe (set))
+                 if (isMode (flagname))
                    {
-                     llerror
-                       (FLG_BADFLAG, 
-                        message 
-                        ("Semantic comment attempts to restore flag %s.  "
-                         "A mode flag cannot be restored.",
-                         flagname));
+                     if (ynm_isMaybe (set))
+                       {
+                         llerror
+                           (FLG_BADFLAG, 
+                            message 
+                            ("Semantic comment attempts to restore flag %s.  "
+                             "A mode flag cannot be restored.",
+                             flagname));
+                       }
+                     else
+                       {
+                         context_setMode (flagname);
+                       }
                    }
                  else
                    {
-                     context_setMode (flagname);
+                     voptgenerror
+                       (FLG_UNRECOGFLAGCOMMENTS,
+                        message ("Unrecognized option in semantic comment: %s", 
+                                 flagname),
+                        loc);
                    }
                }
-             else if (flagcode_isInvalid (fflag))
-               {
-                 voptgenerror
-                   (FLG_UNRECOGFLAGCOMMENTS,
-                    message ("Unrecognized option in semantic comment: %s", 
-                             flagname),
-                    loc);
-               }
              else if (flagcode_isGlobalFlag (fflag))
                {
                  voptgenerror
This page took 0.029844 seconds and 4 git commands to generate.