X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/b072092f32623dab70e6ffe1613740542ea66748..7bf960677344d11a101697c76672a0be4b3759f2:/src/cscanner.l diff --git a/src/cscanner.l b/src/cscanner.l index 66405db..0038eaa 100644 --- a/src/cscanner.l +++ b/src/cscanner.l @@ -1239,7 +1239,6 @@ static bool processMacro (void) e2 = usymtab_lookupExpose (fname); ct = uentry_getType (e2); - if (uentry_isCodeDefined (e2) && fileloc_isUser (uentry_whereDefined (e2))) { @@ -1523,6 +1522,7 @@ static bool processMacro (void) && !uentry_isElipsisMarker (uentryList_getN (specparams, paramno))) { + fileloc sloc = context_getSaveLocation (); uentry decl = uentryList_getN (specparams, paramno); sRef sr; @@ -1530,7 +1530,7 @@ static bool processMacro (void) uentry_setParam (param); - sr = sRef_makeParam (paramno, uentry_getType (param)); + sr = sRef_makeParam (paramno, uentry_getType (param), stateInfo_makeLoc (sloc)); if (sRef_getNullState (sr) == NS_ABSNULL) { @@ -1547,12 +1547,12 @@ static bool processMacro (void) } else { - sRef_setNullState (sr, NS_UNKNOWN, g_currentloc); + sRef_setNullState (sr, NS_UNKNOWN, sloc); } } uentry_setSref (param, sr); - uentry_setDeclaredForceOnly (param, context_getSaveLocation ()); + uentry_setDeclaredForceOnly (param, sloc); skipparam = isiter && uentry_isOut (uentryList_getN (specparams, paramno)); } @@ -1561,11 +1561,11 @@ static bool processMacro (void) fileloc sloc = context_getSaveLocation (); param = uentry_makeVariableSrefParam - (paramname, ctype_unknown, sRef_makeParam (paramno, ctype_unknown)); + (paramname, ctype_unknown, fileloc_copy (sloc), + sRef_makeParam (paramno, ctype_unknown, stateInfo_makeLoc (sloc))); cstring_free (paramname); sRef_setPosNull (uentry_getSref (param), sloc); - uentry_setDeclaredForce (param, sloc); skipparam = FALSE; @@ -1819,7 +1819,11 @@ static bool handleSpecial (char *yyt) if (!(fileId_isValid (fid))) { - if (isHeaderFile (fname)) + if (context_inXHFile ()) + { + fid = fileTable_addXHFile (context_fileTable (), fname); + } + else if (isHeaderFile (fname)) { fid = fileTable_addHeaderFile (context_fileTable (), fname); } @@ -2492,8 +2496,10 @@ static int processIdentifier (cstring id) { uentry le; - DPRINTF (("Process identifier: %s / %s / %s", id, fileloc_unparse (g_currentloc), - bool_unparse (context_inFunctionHeader ()))); + if (context_getFlag (FLG_GRAMMAR)) + { + lldiagmsg (message ("Process identifier: %s", id)); + } context_clearJustPopped (); lastidprocessed = id;