X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/80489f0ab878fa01f87a35988aedff282e5f0ea5..f9264521e093e570a8831d5238ccc3bc20e01119:/src/cscanner.l diff --git a/src/cscanner.l b/src/cscanner.l index 3e962cf..1a8e618 100644 --- a/src/cscanner.l +++ b/src/cscanner.l @@ -84,8 +84,6 @@ ULSuffix ({U}{L}|{L}{U}) # include "cgrammar.h" # include "cgrammar_tokens.h" - -# include "fileIdList.h" # include "portab.h" static bool lastWasString = FALSE; @@ -199,7 +197,7 @@ static void setTokLengthT (size_t len) %% -"/*" { llfatalbug (cstring_makeLiteral ("Comment in pre-processor output")); } +"/*" { llfatalerror (cstring_makeLiteral ("Comment in pre-processor output")); } "#"{Letter}({Letter}|{Digit})* { context_saveLocation (); @@ -271,6 +269,7 @@ 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); } @@ -2049,33 +2048,30 @@ static int handleLlSpecial () { ; } - else if (flagcode_isInvalid (fflag)) + else if (flagcode_isModeName (fflag)) { - if (isMode (flagname)) + if (ynm_isMaybe (set)) { - 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); - } + llerror + (FLG_BADFLAG, + message + ("Semantic comment attempts to restore flag %s. " + "A mode flag cannot be restored.", + flagname)); } else { - voptgenerror - (FLG_UNRECOGFLAGCOMMENTS, - message ("Unrecognized option in semantic comment: %s", - flagname), - loc); + context_setMode (flagname); } } + else if (flagcode_isInvalid (fflag)) + { + voptgenerror + (FLG_UNRECOGFLAGCOMMENTS, + message ("Unrecognized option in semantic comment: %s", + flagname), + loc); + } else if (flagcode_isGlobalFlag (fflag)) { voptgenerror