aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-02-23 13:42:40 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-02-23 13:42:40 +0000
commitab8e22289cf3abb612686e52c1ea370f0aa6c1b1 (patch)
treede2f8a27d5aee9b4df5876515c1a405c129d9ec9 /gcc/cppinit.c
parentac6f8a15d8351deef5c8d47c59dff863f67c3d55 (diff)
downloadgcc-ab8e22289cf3abb612686e52c1ea370f0aa6c1b1.zip
gcc-ab8e22289cf3abb612686e52c1ea370f0aa6c1b1.tar.gz
gcc-ab8e22289cf3abb612686e52c1ea370f0aa6c1b1.tar.bz2
cppinit.c (output_deps): Correct test for stdout output.
* cppinit.c (output_deps): Correct test for stdout output. (init_dependency_output): Cure warning. From-SVN: r49993
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index efaf316..70fc828 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -1102,7 +1102,7 @@ output_deps (pfile)
deps_phony_targets (pfile->deps, deps_stream);
/* Don't close stdout. */
- if (CPP_OPTION (pfile, deps_file))
+ if (deps_stream != stdout)
{
if (ferror (deps_stream) || fclose (deps_stream) != 0)
cpp_fatal (pfile, "I/O error on output");
@@ -1875,16 +1875,16 @@ init_dependency_output (pfile)
else
output_file = spec;
+ /* Command line -MF overrides environment variables and default. */
+ if (CPP_OPTION (pfile, deps_file) == 0)
+ CPP_OPTION (pfile, deps_file) = output_file;
+
CPP_OPTION (pfile, print_deps_append) = 1;
}
- else
+ else if (CPP_OPTION (pfile, deps_file) == 0)
/* If -M or -MM was seen, default output to wherever was specified
with -o. out_fname is non-NULL here. */
- output_file = CPP_OPTION (pfile, out_fname);
-
- /* Command line -MF overrides environment variables and default. */
- if (CPP_OPTION (pfile, deps_file) == 0)
- CPP_OPTION (pfile, deps_file) = output_file;
+ CPP_OPTION (pfile, deps_file) = CPP_OPTION (pfile, out_fname);
/* When doing dependencies, we should suppress all output, including
-dM, -dI etc. */