Commit 4df47bca by Joseph Myers Committed by Joseph Myers

re PR driver/47678 (missing error message for -I)

	PR driver/47678
	* gcc.c (main): Do not compile inputs if there were errors in
	option handling.
	* opts-common.c (read_cmdline_option): Check for wrong language
	after other error checks.

testsuite:
	* gcc.dg/opts-6.c: New test.

From-SVN: r170056
parent 1c31ca71
2011-02-11 Joseph Myers <joseph@codesourcery.com>
PR driver/47678
* gcc.c (main): Do not compile inputs if there were errors in
option handling.
* opts-common.c (read_cmdline_option): Check for wrong language
after other error checks.
2011-02-11 Nathan Froyd <froydnj@codesourcery.com> 2011-02-11 Nathan Froyd <froydnj@codesourcery.com>
* cgraph.c: Fix comment typos. * cgraph.c: Fix comment typos.
......
...@@ -6597,6 +6597,9 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ...@@ -6597,6 +6597,9 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (n_infiles == added_libraries) if (n_infiles == added_libraries)
fatal_error ("no input files"); fatal_error ("no input files");
if (seen_error ())
goto out;
/* Make a place to record the compiler output file names /* Make a place to record the compiler output file names
that correspond to the input files. */ that correspond to the input files. */
...@@ -6864,6 +6867,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ...@@ -6864,6 +6867,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
printf ("%s\n", bug_report_url); printf ("%s\n", bug_report_url);
} }
out:
return (signal_count != 0 ? 2 return (signal_count != 0 ? 2
: seen_error () ? (pass_exit_codes ? greatest_status : 1) : seen_error () ? (pass_exit_codes ? greatest_status : 1)
: 0); : 0);
......
...@@ -960,12 +960,6 @@ read_cmdline_option (struct gcc_options *opts, ...@@ -960,12 +960,6 @@ read_cmdline_option (struct gcc_options *opts,
return; return;
} }
if (decoded->errors & CL_ERR_WRONG_LANG)
{
handlers->wrong_lang_callback (decoded, lang_mask);
return;
}
if (decoded->errors & CL_ERR_MISSING_ARG) if (decoded->errors & CL_ERR_MISSING_ARG)
{ {
if (option->missing_argument_error) if (option->missing_argument_error)
...@@ -1012,6 +1006,12 @@ read_cmdline_option (struct gcc_options *opts, ...@@ -1012,6 +1006,12 @@ read_cmdline_option (struct gcc_options *opts,
return; return;
} }
if (decoded->errors & CL_ERR_WRONG_LANG)
{
handlers->wrong_lang_callback (decoded, lang_mask);
return;
}
gcc_assert (!decoded->errors); gcc_assert (!decoded->errors);
if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED, if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED,
......
2011-02-11 Joseph Myers <joseph@codesourcery.com>
PR driver/47678
* gcc.dg/opts-6.c: New test.
2011-02-11 Jakub Jelinek <jakub@redhat.com> 2011-02-11 Jakub Jelinek <jakub@redhat.com>
PR debug/47684 PR debug/47684
......
/* Missing option arguments take precedence over wrong-language
warnings. */
/* { dg-do compile } */
/* { dg-options "-ftemplate-depth=" } */
/* { dg-error "missing argument" "" { target *-*-* } 0 } */
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