@@ -276,7 +276,6 @@ static void createDumpFile(const Settings& settings,
276276 dumpFile = getDumpFileName (settings, filename);
277277
278278 fdump.open (dumpFile);
279- assert (fdump.is_open ()); // If we ever disable exceptions, catch issues ASAP
280279
281280 // TODO: Technically, exceptions are allowed on the file so this is always false,
282281 // TODO: but the function is not aware of that as this function is not the owner of the file
@@ -287,7 +286,6 @@ static void createDumpFile(const Settings& settings,
287286 std::ofstream fout;
288287 fout.exceptions (std::ios_base::failbit | std::ios_base::badbit);
289288 fout.open (getCtuInfoFileName (dumpFile));
290- assert (fout.is_open ()); // If we ever disable exceptions, catch issues ASAP
291289 }
292290
293291 std::string language;
@@ -526,7 +524,6 @@ unsigned int CppCheck::check(const std::string &path)
526524 std::ofstream fout;
527525 fout.exceptions (std::ios_base::failbit | std::ios_base::badbit);
528526 fout.open (clangcmd);
529- assert (fout.is_open ()); // If we ever disable exceptions, catch issues ASAP
530527 fout << exe << " " << args2 << " " << redirect2 << std::endl;
531528 } else if (mSettings .verbose && !mSettings .quiet ) {
532529 mErrorLogger .reportOut (exe + " " + args2);
@@ -560,7 +557,6 @@ unsigned int CppCheck::check(const std::string &path)
560557 std::ofstream fout;
561558 fout.exceptions (std::ios_base::failbit | std::ios_base::badbit);
562559 fout.open (clangAst);
563- assert (fout.is_open ()); // If we ever disable exceptions, catch issues ASAP
564560 fout << output2 << std::endl;
565561 }
566562
@@ -746,7 +742,6 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
746742 const std::size_t fileNameHash = std::hash<std::string> {}(filename);
747743 filename2 = mSettings .plistOutput + filename2.substr (0 , filename2.find (' .' )) + " _" + std::to_string (fileNameHash) + " .plist" ;
748744 mPlistFile .open (filename2);
749- assert (mPlistFile .is_open ()); // If we ever disable exceptions, catch issues ASAP
750745
751746 mPlistFile << ErrorLogger::plistHeader (version (), files);
752747 }
@@ -1455,7 +1450,6 @@ void CppCheck::executeAddons(const std::vector<std::string>& files)
14551450 std::ofstream fout;
14561451 fout.exceptions (std::ios_base::failbit | std::ios_base::badbit);
14571452 fout.open (fileList);
1458- assert (fout.is_open ()); // If we ever disable exceptions, catch issues ASAP
14591453
14601454 for (const std::string& f: files)
14611455 fout << f << std::endl;
@@ -1719,7 +1713,6 @@ void CppCheck::analyseClangTidy(const ImportProject::FileSettings &fileSettings)
17191713 std::ofstream fcmd;
17201714 fcmd.exceptions (std::ios_base::failbit | std::ios_base::badbit);
17211715 fcmd.open (analyzerInfoFile + " .clang-tidy-cmd" );
1722- assert (fcmd.is_open ()); // If we ever disable exceptions, catch issues ASAP
17231716
17241717 fcmd << istr.str ();
17251718 }
0 commit comments