From ab8e22289cf3abb612686e52c1ea370f0aa6c1b1 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 23 Feb 2002 13:42:40 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/cppinit.c | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd9a308038d..6e6db2802c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-02-23 Neil Booth + + * cppinit.c (output_deps): Correct test for stdout output. + (init_dependency_output): Cure warning. + Sat Feb 23 08:42:47 2002 Richard Kenner * expr.c (store_expr): When converting expression to promoted diff --git a/gcc/cppinit.c b/gcc/cppinit.c index efaf3166afb..70fc828dd2b 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. */ -- 2.30.2