Fixed cc65 exitcode when there are only preprocessor errors.
This commit is contained in:
@@ -1089,7 +1089,7 @@ int main (int argc, char* argv[])
|
|||||||
Compile (InputFile);
|
Compile (InputFile);
|
||||||
|
|
||||||
/* Create the output file if we didn't had any errors */
|
/* Create the output file if we didn't had any errors */
|
||||||
if (PreprocessOnly == 0 && (ErrorCount == 0 || Debug)) {
|
if (PreprocessOnly == 0 && (GetTotalErrors () == 0 || Debug)) {
|
||||||
|
|
||||||
/* Emit literals, do cleanup and optimizations */
|
/* Emit literals, do cleanup and optimizations */
|
||||||
FinishCompile ();
|
FinishCompile ();
|
||||||
@@ -1115,5 +1115,5 @@ int main (int argc, char* argv[])
|
|||||||
DoneSegAddrSizes ();
|
DoneSegAddrSizes ();
|
||||||
|
|
||||||
/* Return an apropriate exit code */
|
/* Return an apropriate exit code */
|
||||||
return (ErrorCount > 0)? EXIT_FAILURE : EXIT_SUCCESS;
|
return (GetTotalErrors () > 0)? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
8
test/err/bug2312-pperror-only.c
Normal file
8
test/err/bug2312-pperror-only.c
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/* Bug #2312 */
|
||||||
|
|
||||||
|
#error "Compiler should exit with failure"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user