FILE *f = popen(buf, "r");
if (f == NULL) {
fprintf(stderr, "invoking preprocessor failed\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* we don't really need that anymore */
int err = system(buf);
if (err != 0) {
fprintf(stderr, "assembler reported an error\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
obstack_free(&asflags_obst, NULL);
int err = system(commandline);
if (err != EXIT_SUCCESS) {
fprintf(stderr, "linker reported an error\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (fd == -1) {
fprintf(stderr, "couldn't create temporary file: %s\n",
strerror(errno));
- exit(1);
+ exit(EXIT_FAILURE);
}
FILE *out = fdopen(fd, "w");
if (out == NULL) {
fprintf(stderr, "couldn't create temporary file FILE*\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
file_list_entry_t *entry = xmalloc(sizeof(*entry));
if (in == NULL) {
fprintf(stderr, "Couldn't open '%s': %s\n", filename,
strerror(errno));
- exit(1);
+ exit(EXIT_FAILURE);
}
return in;
do_timing = true;
} else if (streq(option, "version")) {
print_cparser_version();
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
} else if (streq(option, "help")) {
print_help(argv[0]);
help_displayed = true;
in = open_file(filename);
lextest(in, filename);
fclose(in);
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
FILE *preprocessed_in = NULL;
/* remove output file */
if (out != stdout)
unlink(outname);
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
}
if (irg == NULL) {
fprintf(stderr, "No graph for function '%s' found\n",
dumpfunction);
- exit(1);
+ return EXIT_FAILURE;
}
dump_ir_graph_file(out, irg);
fclose(out);
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
if (mode == CompileExportIR) {
fclose(out);
ir_export(outname);
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
gen_firm_finish(asm_out, filename, have_const_functions);
int err = system(commandline);
if (err != EXIT_SUCCESS) {
fprintf(stderr, "linker reported an error\n");
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
}