Skip to content

Commit 7124520

Browse files
committed
main.cpp: replaced std::exit() with return
1 parent 6c9eaf4 commit 7124520

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ int main(int argc, char **argv)
8181
}
8282
} else if (filename) {
8383
std::cout << "error: multiple filenames specified" << std::endl;
84-
std::exit(1);
84+
return 1;
8585
} else {
8686
filename = arg;
8787
}
8888
}
8989

9090
if (error)
91-
std::exit(1);
91+
return 1;
9292

9393
if (quiet && error_only) {
9494
std::cout << "error: -e cannot be used in conjunction with -q" << std::endl;
95-
std::exit(1);
95+
return 1;
9696
}
9797

9898
if (!filename) {
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
107107
std::cout << " -is Use std::istream interface." << std::endl;
108108
std::cout << " -e Output errors only." << std::endl;
109109
std::cout << " -f Fail when errors were encountered (exitcode 1)." << std::endl;
110-
std::exit(0);
110+
return 0;
111111
}
112112

113113
dui.removeComments = true;
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
120120
std::ifstream f(filename);
121121
if (!f.is_open()) {
122122
std::cout << "error: could not open file '" << filename << "'" << std::endl;
123-
std::exit(1);
123+
return 1;
124124
}
125125
rawtokens = new simplecpp::TokenList(f, files,filename,&outputList);
126126
} else {

0 commit comments

Comments
 (0)