@@ -288,8 +288,6 @@ static void createDumpFile(const Settings& settings,
288288 fout.exceptions (std::ios_base::failbit | std::ios_base::badbit);
289289 fout.open (getCtuInfoFileName (dumpFile));
290290 assert (fout.is_open ()); // If we ever disable exceptions, catch issues ASAP
291- fout.close ();
292- assert (fout.good ()); // If we ever disable exceptions, catch issues ASAP
293291 }
294292
295293 std::string language;
@@ -423,7 +421,6 @@ CppCheck::~CppCheck()
423421 try
424422 {
425423 mPlistFile .close ();
426- assert (mPlistFile .good ()); // If we ever disable exceptions, catch issues ASAP
427424 }
428425 catch (const std::ios_base::failure&)
429426 {
@@ -531,8 +528,6 @@ unsigned int CppCheck::check(const std::string &path)
531528 fout.open (clangcmd);
532529 assert (fout.is_open ()); // If we ever disable exceptions, catch issues ASAP
533530 fout << exe << " " << args2 << " " << redirect2 << std::endl;
534- fout.close ();
535- assert (fout.good ()); // If we ever disable exceptions, catch issues ASAP
536531 } else if (mSettings .verbose && !mSettings .quiet ) {
537532 mErrorLogger .reportOut (exe + " " + args2);
538533 }
@@ -567,8 +562,6 @@ unsigned int CppCheck::check(const std::string &path)
567562 fout.open (clangAst);
568563 assert (fout.is_open ()); // If we ever disable exceptions, catch issues ASAP
569564 fout << output2 << std::endl;
570- fout.close ();
571- assert (fout.good ()); // If we ever disable exceptions, catch issues ASAP
572565 }
573566
574567 try {
@@ -602,7 +595,6 @@ unsigned int CppCheck::check(const std::string &path)
602595 fdump << " </dump>" << std::endl;
603596 fdump << " </dumps>" << std::endl;
604597 fdump.close ();
605- assert (fdump.good ()); // If we ever disable exceptions, catch issues ASAP
606598 }
607599
608600 // run addons
@@ -698,9 +690,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
698690
699691 if (mPlistFile .is_open ()) {
700692 mPlistFile << ErrorLogger::plistFooter ();
701-
702693 mPlistFile .close ();
703- assert (mPlistFile .good ()); // If we ever disable exceptions, catch issues ASAP
704694 }
705695
706696 CheckUnusedFunctions checkUnusedFunctions (nullptr , nullptr , nullptr );
@@ -1041,7 +1031,6 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
10411031 if (fdump.is_open ()) {
10421032 fdump << " </dumps>" << std::endl;
10431033 fdump.close ();
1044- assert (fdump.good ()); // If we ever disable exceptions, catch issues ASAP
10451034 }
10461035
10471036 executeAddons (dumpFile);
@@ -1470,9 +1459,6 @@ void CppCheck::executeAddons(const std::vector<std::string>& files)
14701459
14711460 for (const std::string& f: files)
14721461 fout << f << std::endl;
1473-
1474- fout.close ();
1475- assert (fout.good ()); // If we ever disable exceptions, catch issues ASAP
14761462 }
14771463
14781464 for (const std::string &addon : mSettings .addons ) {
@@ -1736,9 +1722,6 @@ void CppCheck::analyseClangTidy(const ImportProject::FileSettings &fileSettings)
17361722 assert (fcmd.is_open ()); // If we ever disable exceptions, catch issues ASAP
17371723
17381724 fcmd << istr.str ();
1739-
1740- fcmd.close ();
1741- assert (fcmd.good ()); // If we ever disable exceptions, catch issues ASAP
17421725 }
17431726
17441727 while (std::getline (istr, line)) {
0 commit comments