X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/53306cab3dabf761f459f8f5fdc4b30eca6ec707..061ece7d6fedbde47030222fea74b575c12707dc:/src/llmain.c diff --git a/src/llmain.c b/src/llmain.c index fa9b8fe..e2b29b5 100644 --- a/src/llmain.c +++ b/src/llmain.c @@ -1,6 +1,6 @@ /* ** Splint - annotation-assisted static program checker -** Copyright (C) 1994-2002 University of Virginia, +** Copyright (C) 1994-2003 University of Virginia, ** Massachusetts Institute of Technology ** ** This program is free software; you can redistribute it and/or modify it @@ -49,10 +49,9 @@ # endif # include "splintMacros.nf" -# include "llbasic.h" +# include "basic.h" # include "osd.h" # include "help.h" - # include "gram.h" # include "lclscan.h" # include "scanline.h" @@ -71,9 +70,8 @@ # include "Headers/version.h" /* Visual C++ finds the wrong version.h */ # include "lcllib.h" # include "cgrammar.h" +# include "rcfiles.h" # include "llmain.h" -# include "portab.h" - extern /*@external@*/ int yydebug; static void cleanupFiles (void); @@ -554,7 +552,7 @@ int main (int argc, char *argv[]) if (++i < argc) { fname = cstring_fromChars (argv[i]); - setStringFlag (opt, fname); + flags_setStringFlag (opt, fname); } else { @@ -824,8 +822,10 @@ int main (int argc, char *argv[]) ** will be ..c) */ + /* Why was this here? It is always a bug... */ +# if 0 { -# ifdef WIN32 +# if defined (WIN32) || defined (OS2) && defined (__IBMC__) int nfiles = /*@-unrecog@*/ _fcloseall (); /*@=unrecog@*/ if (nfiles != 0) @@ -834,6 +834,7 @@ int main (int argc, char *argv[]) } # endif } +# endif DPRINTF (("Initializing...")); @@ -1089,6 +1090,13 @@ int main (int argc, char *argv[]) } cstring_free (specErrors); + + if (context_numBugs () > 0) { + expsuccess = FALSE; + if (!isQuiet) { + llmsg (message (" %d internal bugs reported", context_numBugs ())); + } + } } if (context_getFlag (FLG_STATS)) @@ -1096,7 +1104,7 @@ int main (int argc, char *argv[]) clock_t ttime = clock () - before; int specLines = context_getSpecLinesProcessed (); cstring specmsg = cstring_undefined; - + rstime = clock (); if (specLines > 0) @@ -1143,7 +1151,12 @@ int main (int argc, char *argv[]) if (anylcl) { + /* Gack: really should figure out how to make configure find snprintf... */ +# ifdef WIN32 + (void) _snprintf (msg, 256, +# else (void) snprintf (msg, 256, +# endif "Time distribution (percent): initialize %.2f / lcl %.2f / " "pre-process %.2f / c check %.2f / finalize %.2f \n", (100.0 * (double) (libtime - before) / ttime), @@ -1154,7 +1167,11 @@ int main (int argc, char *argv[]) } else { +# ifdef WIN32 + (void) _snprintf (msg, 256, +# else (void) snprintf (msg, 256, +# endif "Time distribution (percent): initialize %.2f / " "pre-process %.2f / c check %.2f / finalize %.2f \n", (100.0 * (double) (libtime - before) / ttime), @@ -1244,7 +1261,7 @@ cleanupFiles (void) } else { -# ifdef WIN32 +# if defined (WIN32) || defined (OS2) && defined (__IBMC__) int nfiles = /*@-unrecog@*/ _fcloseall (); /*@=unrecog@*/ if (nfiles != 0) @@ -1267,7 +1284,7 @@ llexit (int status) { DPRINTF (("llexit: %d", status)); -# ifdef WIN32 +# if defined (WIN32) || defined (OS2) && defined (__IBMC__) if (status == LLFAILURE) { _fcloseall (); @@ -1279,7 +1296,13 @@ llexit (int status) if (status != LLFAILURE) { usymtab_destroyMod (); - context_destroyMod (); + + /*drl I'm commenting this line out + because it is causing Splint to crash when built with + 2.95 I'm not sure if this is a compiler bug or if if has to do with bool + Any way if we're going to exist the program why do we bother freeing stuff... + */ + /* context_destroyMod (); */ exprNode_destroyMod (); cppReader_destroyMod (); sRef_destroyMod ();