From: Michael Beck Date: Tue, 14 Oct 2008 01:08:32 +0000 (+0000) Subject: - warn if a config file could not be opened X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=68d9f359de0faaa48e5a0cb3c656d6ed7b1daca2;p=libfirm - warn if a config file could not be opened [r22860] --- diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 391d13669..6fb7677e6 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -881,11 +881,13 @@ void be_main(FILE *file_handle, const char *cup_name) /* The user specified another config file to read. do that now. */ if (config_file[0] != '\0') { - FILE *f; + FILE *f = fopen(config_file, "rt"); - if ((f = fopen(config_file, "rt")) != NULL) { + if (f != NULL) { lc_opt_from_file(config_file, f, NULL); fclose(f); + } else { + fprintf(stderr, "Warning: Cannot open config file '%s'\n", config_file); } }