Commit 8e974c0e by Per Bothner Committed by Per Bothner

c-opts.c (finish_options): Change to returns boolean - false iff the call to…

c-opts.c (finish_options): Change to returns boolean - false iff the call to cpp_find_main_file fails.


	* c-opts.c (finish_options):  Change to returns boolean - false iff
	the call to cpp_find_main_file fails.
	(c_common_init):  Skip preprocess_file if finish_options failed.
	(c_common_parse_file):  Break if finish_options failed.

From-SVN: r73170
parent e31f8eda
2003-10-31 Per Bothner <pbothner@apple.com>
* c-opts.c (finish_options): Change to returns boolean - false iff
the call to cpp_find_main_file fails.
(c_common_init): Skip preprocess_file if finish_options failed.
(c_common_parse_file): Break if finish_options failed.
2003-10-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2003-10-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* aclocal.m4: Blacklist ultrix* for mmap file. * aclocal.m4: Blacklist ultrix* for mmap file.
......
...@@ -108,7 +108,7 @@ static void sanitize_cpp_opts (void); ...@@ -108,7 +108,7 @@ static void sanitize_cpp_opts (void);
static void add_prefixed_path (const char *, size_t); static void add_prefixed_path (const char *, size_t);
static void push_command_line_include (void); static void push_command_line_include (void);
static void cb_file_change (cpp_reader *, const struct line_map *); static void cb_file_change (cpp_reader *, const struct line_map *);
static void finish_options (const char *); static bool finish_options (const char *);
#ifndef STDC_0_IN_SYSTEM_HEADERS #ifndef STDC_0_IN_SYSTEM_HEADERS
#define STDC_0_IN_SYSTEM_HEADERS 0 #define STDC_0_IN_SYSTEM_HEADERS 0
...@@ -1183,8 +1183,8 @@ c_common_init (void) ...@@ -1183,8 +1183,8 @@ c_common_init (void)
if (flag_preprocess_only) if (flag_preprocess_only)
{ {
finish_options (in_fnames[0]); if (finish_options (in_fnames[0]))
preprocess_file (parse_in); preprocess_file (parse_in);
return false; return false;
} }
...@@ -1220,7 +1220,8 @@ c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED) ...@@ -1220,7 +1220,8 @@ c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
cpp_undef_all (parse_in); cpp_undef_all (parse_in);
} }
finish_options(in_fnames[file_index]); if (! finish_options(in_fnames[file_index]))
break;
if (file_index == 0) if (file_index == 0)
pch_init(); pch_init();
c_parse_file (); c_parse_file ();
...@@ -1387,8 +1388,8 @@ add_prefixed_path (const char *suffix, size_t chain) ...@@ -1387,8 +1388,8 @@ add_prefixed_path (const char *suffix, size_t chain)
/* Handle -D, -U, -A, -imacros, and the first -include. /* Handle -D, -U, -A, -imacros, and the first -include.
TIF is the input file to which we will return after processing all TIF is the input file to which we will return after processing all
the includes. */ the includes. Returns true on success. */
static void static bool
finish_options (const char *tif) finish_options (const char *tif)
{ {
if (!cpp_opts->preprocessed) if (!cpp_opts->preprocessed)
...@@ -1441,8 +1442,10 @@ finish_options (const char *tif) ...@@ -1441,8 +1442,10 @@ finish_options (const char *tif)
include_cursor = 0; include_cursor = 0;
this_input_filename = tif; this_input_filename = tif;
cpp_find_main_file (parse_in, this_input_filename); if (! cpp_find_main_file (parse_in, this_input_filename))
return false;
push_command_line_include (); push_command_line_include ();
return true;
} }
/* Give CPP the next file given by -include, if any. */ /* Give CPP the next file given by -include, if any. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment