Commit 2dec80c7 by Joseph Myers Committed by Joseph Myers

re PR driver/15303 (When gcc sees an unrecognized option, the exit status indicates success)

	PR driver/15303
	* gcc.c (inform, warning, inform): New functions.
	(fatal_ice): Rename to internal_error; change cmsgid parameter to
	gmsgid.  All callers changed.
	(notice): Rename to fnotice; add parameter fp.  All callers
	changed.
	(fatal_error): Rename to fatal_signal.  All users changed.
	(fatal): Rename to fatal_error; change cmsgid parameter to
	gmsgid.  All callers changed.
	(process_command): Use warning instead of error for warnings.
	(end_going_arg): Don't use _() around argument of error.
	(do_spec_1): Use inform for message from %n specs.  Use warning
	instead of error for warnings.
	(main): Use inform for comparison messages.  Use warning for
	message about unused linker input.
	(error): Increment error_count.  Print "error: ".
	* gcc.h (fatal): Change to fatal_error.
	(warning): Declare.
	* config/darwin-driver.c (darwin_default_min_version): Use warning
	instead of fprintf for warnings.
	* cppspec.c (lang_specific_driver): Use fatal_error instead of
	fatal.

cp:
	* g++spec.c (lang_specific_driver): Use fatal_error instead of
	fatal.

fortran:
	* gfortranspec.c (append_arg, lang_specific_driver): Use
	fatal_error instead of fatal.  Use warning instead of fprintf for
	warnings.

java:
	* jvspec.c (lang_specific_driver): Use fatal_error instead of
	fatal.  Use warning instead of error for warnings.

From-SVN: r159986
parent 7325b1b3
2010-05-28 Joseph Myers <joseph@codesourcery.com>
PR driver/15303
* gcc.c (inform, warning, inform): New functions.
(fatal_ice): Rename to internal_error; change cmsgid parameter to
gmsgid. All callers changed.
(notice): Rename to fnotice; add parameter fp. All callers
changed.
(fatal_error): Rename to fatal_signal. All users changed.
(fatal): Rename to fatal_error; change cmsgid parameter to
gmsgid. All callers changed.
(process_command): Use warning instead of error for warnings.
(end_going_arg): Don't use _() around argument of error.
(do_spec_1): Use inform for message from %n specs. Use warning
instead of error for warnings.
(main): Use inform for comparison messages. Use warning for
message about unused linker input.
(error): Increment error_count. Print "error: ".
* gcc.h (fatal): Change to fatal_error.
(warning): Declare.
* config/darwin-driver.c (darwin_default_min_version): Use warning
instead of fprintf for warnings.
* cppspec.c (lang_specific_driver): Use fatal_error instead of
fatal.
2010-05-28 Julian Brown <julian@codesourcery.com>
* config/arm/thumb2.md (*thumb2_addsi3_compare0): New.
......
/* Additional functions for the GCC driver on Darwin native.
Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
This file is part of GCC.
......@@ -107,7 +107,7 @@ darwin_default_min_version (int * argc_p, char *** argv_p)
if (sysctl (osversion_name, ARRAY_SIZE (osversion_name), osversion,
&osversion_len, NULL, 0) == -1)
{
fprintf (stderr, "sysctl for kern.osversion failed: %s\n",
warning (0, "sysctl for kern.osversion failed: %s",
xstrerror (errno));
return;
}
......@@ -151,7 +151,7 @@ darwin_default_min_version (int * argc_p, char *** argv_p)
return;
parse_failed:
fprintf (stderr, "couldn't understand kern.osversion `%.*s'\n",
warning (0, "couldn't understand kern.osversion `%.*s'",
(int) osversion_len, osversion);
return;
}
......
2010-05-28 Joseph Myers <joseph@codesourcery.com>
* g++spec.c (lang_specific_driver): Use fatal_error instead of
fatal.
2010-05-28 Dodji Seketeli <dodji@redhat.com>
Revert fix of PR c++/44188
......
/* Specific flags and argument handling of the C++ front end.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2007, 2008, 2009 Free Software Foundation, Inc.
2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
......@@ -258,7 +258,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
}
if (quote)
fatal ("argument to '%s' missing\n", quote);
fatal_error ("argument to '%s' missing\n", quote);
/* There's no point adding -shared-libgcc if we don't have a shared
libgcc. */
......
/* Specific flags and argument handling of the C preprocessor.
Copyright (C) 1999, 2007 Free Software Foundation, Inc.
Copyright (C) 1999, 2007, 2010 Free Software Foundation, Inc.
This file is part of GCC.
......@@ -103,8 +103,8 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
need_E = 0;
else if (argv[i][1] == 'S' || argv[i][1] == 'c')
{
fatal ("\"%s\" is not a valid option to the preprocessor",
argv[i]);
fatal_error ("\"%s\" is not a valid option to the "
"preprocessor", argv[i]);
return;
}
else if (argv[i][1] == 'x')
......@@ -125,7 +125,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
seen_input++;
if (seen_input == 3)
{
fatal ("too many input files");
fatal_error ("too many input files");
return;
}
else if (seen_input == 2)
......
2010-05-28 Joseph Myers <joseph@codesourcery.com>
* gfortranspec.c (append_arg, lang_specific_driver): Use
fatal_error instead of fatal. Use warning instead of fprintf for
warnings.
2010-05-28 Joseph Myers <joseph@codesourcery.com>
* cpp.c (gfc_cpp_init_0): Use xstrerror instead of strerror.
* module.c (write_char, gfc_dump_module, gfc_use_module): Use
xstrerror instead of strerror.
......
......@@ -244,7 +244,7 @@ append_arg (const char *arg)
}
if (g77_newargc == newargsize)
fatal ("overflowed output arg list for '%s'", arg);
fatal_error ("overflowed output arg list for '%s'", arg);
g77_newargv[g77_newargc++] = arg;
}
......@@ -402,11 +402,11 @@ For more information about these matters, see the file named COPYING\n\n"));
if (i + skip < argc)
i += skip;
else
fatal ("argument to '%s' missing", argv[i]);
fatal_error ("argument to '%s' missing", argv[i]);
}
if ((n_outfiles != 0) && (n_infiles == 0))
fatal ("no input files; unwilling to write output files");
fatal_error ("no input files; unwilling to write output files");
/* If there are no input files, no need for the library. */
if (n_infiles == 0)
......@@ -428,8 +428,7 @@ For more information about these matters, see the file named COPYING\n\n"));
{
char *p;
fprintf (stderr, _("Warning: Using -M <directory> is deprecated, "
"use -J instead\n"));
warning (0, "using -M <directory> is deprecated, use -J instead");
if (argv[i][2] == '\0')
{
if (i+1 < argc)
......@@ -441,7 +440,7 @@ For more information about these matters, see the file named COPYING\n\n"));
i++;
}
else
fatal ("argument to '%s' missing", argv[i]);
fatal_error ("argument to '%s' missing", argv[i]);
}
else
{
......
......@@ -59,8 +59,10 @@ struct spec_function
/* These are exported by gcc.c. */
extern int do_spec (const char *);
extern void record_temp_file (const char *, int, int);
extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void fatal_error (const char *, ...)
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void warning (int, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void pfatal_with_name (const char *) ATTRIBUTE_NORETURN;
extern void set_input (const char *);
......
2010-05-28 Joseph Myers <joseph@codesourcery.com>
* jvspec.c (lang_specific_driver): Use fatal_error instead of
fatal. Use warning instead of error for warnings.
2010-05-28 Nathan Froyd <froydnj@codesourcery.com>
* expr.c (get_symbol_table_index): Add spaces in expression.
......
/* Specific flags and argument handling of the front-end of the
GNU compiler for the Java(TM) language.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007 Free Software Foundation, Inc.
2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
......@@ -400,33 +400,33 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
}
if (quote)
fatal ("argument to '%s' missing\n", quote);
fatal_error ("argument to '%s' missing\n", quote);
if (saw_D && ! main_class_name)
fatal ("can't specify '-D' without '--main'\n");
fatal_error ("can't specify '-D' without '--main'\n");
if (main_class_name && ! verify_class_name (main_class_name))
fatal ("'%s' is not a valid class name", main_class_name);
fatal_error ("'%s' is not a valid class name", main_class_name);
num_args = argc + added;
if (saw_resource)
{
if (! saw_o)
fatal ("--resource requires -o");
fatal_error ("--resource requires -o");
}
if (saw_C)
{
num_args += 3;
if (class_files_count + zip_files_count > 0)
{
error ("warning: already-compiled .class files ignored with -C");
warning (0, "already-compiled .class files ignored with -C");
num_args -= class_files_count + zip_files_count;
class_files_count = 0;
zip_files_count = 0;
}
num_args += 2; /* For -o NONE. */
if (saw_o)
fatal ("cannot specify both -C and -o");
fatal_error ("cannot specify both -C and -o");
}
if ((saw_o && java_files_count + class_files_count + zip_files_count > 1)
|| (saw_C && java_files_count > 1)
......@@ -438,7 +438,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
{
filelist_filename = make_temp_file ("jx");
if (filelist_filename == NULL)
fatal ("cannot create temporary file");
fatal_error ("cannot create temporary file");
record_temp_file (filelist_filename, ! saw_save_temps, 0);
filelist_file = fopen (filelist_filename, "w");
if (filelist_file == NULL)
......@@ -460,7 +460,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
if (combine_inputs || indirect_files_count > 0)
num_args += 1; /* for "-ffilelist-file" */
if (combine_inputs && indirect_files_count > 0)
fatal("using both @FILE with multiple files not implemented");
fatal_error ("using both @FILE with multiple files not implemented");
/* There's no point adding -shared-libgcc if we don't have a shared
libgcc. */
......@@ -582,7 +582,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
if (strncmp (argv[i], "-fmain=", 7) == 0)
{
if (! will_link)
fatal ("cannot specify 'main' class when not linking");
fatal_error ("cannot specify 'main' class when not linking");
--j;
continue;
}
......
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