static void printIndentMessage (FILE *p_stream, /*@only@*/ cstring p_sc, int p_indent)
/*@modifies *p_stream@*/ ;
-# ifndef NOLCL
static int lclerrors = 0;
-# endif
-
static size_t lastfileloclen = 10;
static /*@only@*/ cstring lastmsg = cstring_undefined;
static int mcount = 0;
&& context_getFlag (FLG_SHOWSCAN))
{
llflush ();
- displayScanOpen (cstring_makeLiteral ("< more preprocessing ."));
+ displayScanOpen (cstring_makeLiteral ("more preprocessing ."));
llassertprotect (!s_needsPrepare);
s_needsPrepare = TRUE;
}
{
if (context_getFlag (FLG_WARNFLAGS))
{
- showHerald ();
-
- if (fileloc_isBuiltin (g_currentloc))
- {
- llmsg (message ("Warning: %q", s));
- }
- else
- {
- llgenmsg (message ("Warning: %q", s), g_currentloc);
- }
+ llgenmsg (s, g_currentloc);
}
else
{
{
if (!bool_equal (ctype_isSigned (ut1), ctype_isSigned (ut2)))
{
- hcode = FLG_IGNORESIGNS;
+ if (ctype_isArbitraryIntegral (ctype_realType (ut1))
+ && !ctype_isArbitraryIntegral (ctype_realType (ut2)))
+ {
+ hcode = FLG_MATCHANYINTEGRAL;
+ }
+ else if (ctype_isArbitraryIntegral (ctype_realType (ut2))
+ && !ctype_isArbitraryIntegral (ctype_realType (ut1)))
+ {
+ hcode = FLG_MATCHANYINTEGRAL;
+ }
+ else
+ {
+ hcode = FLG_IGNORESIGNS;
+ }
}
else
{
if (hcode != INVALID_FLAG && hcode != ocode)
{
code = hcode;
- llshowhint (code);
+ if (context_flagOn (code, fl))
+ {
+ /* The flag is alreay set, something buggy in the flag code */
+ llcontbug (message ("No hint available, flag %s is already set.",
+ flagcode_unparse (code)));
+ }
+ else
+ {
+ llshowhint (code);
+ }
}
else
{
llexit (LLFAILURE);
}
-# ifndef NOLCL
void
lclfatalbug (char *msg)
{
printBugReport ();
llexit (LLFAILURE);
}
-# endif
void
checkParseError (void)
inbug = FALSE;
}
-# ifndef NOLCL
void
lclbug (/*@only@*/ cstring s)
{
fprintf (g_errorstream, " (attempting to continue, results may be incorrect)\n");
closeMessage ();
}
-# endif
void
-llfatalerror (cstring s)
+xllfatalerror (char *srcFile, int srcLine, cstring s)
{
prepareMessage ();
printError (g_errorstream, s);
printError (g_errorstream, cstring_makeLiteral ("*** Cannot continue."));
+ showSourceLoc (srcFile, srcLine);
llexit (LLFAILURE);
}
void
-llfatalerrorLoc (/*@only@*/ cstring s)
+xllfatalerrorLoc (char *srcFile, int srcLine, /*@only@*/ cstring s)
{
prepareMessage ();
(void) fflush (g_warningstream);
printError (g_errorstream, message ("%q: %q", fileloc_unparse (g_currentloc), s));
printError (g_errorstream, cstring_makeLiteral ("*** Cannot continue."));
+ showSourceLoc (srcFile, srcLine);
(void) fflush (g_warningstream);
llexit (LLFAILURE);
}
-# ifndef NOLCL
bool
lclHadError (void)
{
lclerror (id, message ("Identifier redeclared: %s", s));
}
}
-# endif
void genppllerror (flagcode code, /*@only@*/ cstring s)
{
return FALSE;
}
-void llparseerror (cstring s)
+void xllparseerror (char *srcFile, int srcLine, cstring s)
{
if (context_getFlag (FLG_TRYTORECOVER))
{
{
if (cstring_isDefined (s))
{
- llfatalerror (message ("%q: Parse Error: %q. "
- "Too many errors, giving up.",
- fileloc_unparse (g_currentloc), s));
+ xllfatalerror (srcFile, srcLine,
+ message ("%q: Parse Error: %q. "
+ "Too many errors, giving up.",
+ fileloc_unparse (g_currentloc), s));
}
else
{
- llfatalerror (message ("%q: Parse Error. Too many errors, giving up.",
- fileloc_unparse (g_currentloc)));
+ xllfatalerror (srcFile, srcLine,
+ message ("%q: Parse Error. Too many errors, giving up.",
+ fileloc_unparse (g_currentloc)));
}
}
else
{
llreportparseerror (message ("Parse Error: %q. Attempting to continue.",
s));
+ showSourceLoc (srcFile, srcLine);
}
else
{
llreportparseerror (message ("Parse Error. Attempting to continue."));
+ showSourceLoc (srcFile, srcLine);
}
}
}
msg = message ("Parse Error.");
}
- llfatalerror
- (message ("%q: %s (For help on parse errors, "
+ xllfatalerror
+ (srcFile, srcLine,
+ message ("%q: %s (For help on parse errors, "
"see splint -help parseerrors.)",
fileloc_unparse (g_currentloc), msg));
}
void displayScan (cstring msg)
{
+ if (s_scanOpen)
+ {
+ displayScanClose ();
+ }
+
llassert (!s_scanOpen);
if (context_getFlag (FLG_SHOWSCAN))
{
+ showHerald ();
fprintf (g_messagestream, "< %s >\n", cstring_toCharsSafe (msg));
(void) fflush (g_messagestream);
}
void displayScanOpen (cstring msg)
{
+ if (s_scanOpen)
+ {
+ displayScanClose ();
+ }
+
llassert (!s_scanOpen);
s_scanOpen = TRUE;