]> andersk Git - splint.git/blobdiff - src/cscanner.l
Fixed handling of __FUNCTION__
[splint.git] / src / cscanner.l
index f698ef61a45caea075975a9b246ee181e45c22f5..eddfd1d88c91147a453a369bf848e03faa483545 100644 (file)
@@ -1695,7 +1695,6 @@ static bool processMacro (void)
 static bool handleSpecial (char *yyt)
 {
   char *l = mstring_create (MAX_NAME_LENGTH);
-  static bool reportcpp = FALSE;
   int lineno = 0;
   char c;
   char *ol;
@@ -1889,18 +1888,15 @@ static bool handleSpecial (char *yyt)
        mstring_free (ol);
        return FALSE;
       } else {
-       if (!reportcpp)
-         {
-           
-         } else {
-           llbug (message ("File contains preprocessor command: #%s", 
-                           cstring_fromChars (ol)));
-           reportcpp = TRUE;
-         }
+       voptgenerror
+         (FLG_UNRECOGDIRECTIVE,
+          message ("Unrecognized pre-processor directive: #%s", 
+                   cstring_fromChars (ol)),
+          g_currentloc);
       }
       
       sfree (ol);
-      return TRUE;
+      return FALSE; /* evans 2001-12-30: was: TRUE; */
     }
 
   sfree (ol);
@@ -2644,7 +2640,8 @@ static int processIdentifier (cstring id)
               || cstring_equalLit (id, "__PRETTY_FUNCTION__")) 
        {
          /* These tokens hold the name of the current function as strings */
-         yylval.expr = exprNode_stringLiteral (id, fileloc_copy (g_currentloc));
+         /* evans 2001-12-30: changed from exprNode_stringLiteral; bug reported by Jim Zelenka. */
+         yylval.expr = exprNode_makeConstantString (id, fileloc_copy (g_currentloc));
          tokLength = 0;
          lastWasString = TRUE;
          tok = CCONSTANT;
@@ -2855,6 +2852,10 @@ static bool processHashIdentifier (/*@only@*/ cstring id)
     }
   else
     {
+      /*
+      ** Will be handled by handleLlSpecial
+      */
+
       cstring_free (id);
       return FALSE;
     }
This page took 0.080023 seconds and 4 git commands to generate.