Skip to content

Commit 8aa3b3b

Browse files
committed
[FIX] Fix return value of main() in program failed
1 parent b1754db commit 8aa3b3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/cppfront.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2670,10 +2670,11 @@ auto main(int argc, char* argv[]) -> int
26702670

26712671
if (cmdline.arguments().empty()) {
26722672
std::cout << "cppfront: error: no input files\n";
2673-
return 0;
2673+
return EXIT_FAILURE;
26742674
}
26752675

26762676
// For each .cpp2 source file
2677+
int exit_status = EXIT_SUCCESS;
26772678
for (auto const& arg : cmdline.arguments())
26782679
{
26792680
std::cout << arg.text << "...";
@@ -2701,6 +2702,7 @@ auto main(int argc, char* argv[]) -> int
27012702
std::cout << "\n";
27022703
c.print_errors();
27032704
std::cout << "\n";
2705+
exit_status = EXIT_FAILURE;
27042706
}
27052707

27062708
// In any case, emit the debug information (during early development this is
@@ -2709,4 +2711,5 @@ auto main(int argc, char* argv[]) -> int
27092711
c.debug_print();
27102712
}
27112713
}
2714+
return exit_status;
27122715
}

0 commit comments

Comments
 (0)