c-opts.c (missing_arg): Make non-static.

* c-opts.c (missing_arg): Make non-static.
	(c_common_handle_option): Don't check for missing arguments.
	* opts.c (handle_option): Check for missing arguments.
ada:
	* misc.c (gnat_handle_option): Don't check for missing arguments.
f:
	* top.c (ffe_handle_option): Don't check for missing arguments.
java:
	* lang.c (java_handle_option): Don't check for missing arguments.
testsuite:
	* const-str-2.m: Update.

From-SVN: r68517
This commit is contained in:
Neil Booth 2003-06-26 06:05:36 +00:00 committed by Neil Booth
parent 09ec461d3b
commit 9eee5e726d
11 changed files with 31 additions and 30 deletions

View File

@ -1,3 +1,9 @@
2003-06-26 Neil Booth <neil@daikokuya.co.uk>
* c-opts.c (missing_arg): Make non-static.
(c_common_handle_option): Don't check for missing arguments.
* opts.c (handle_option): Check for missing arguments.
2003-06-26 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/power4.md (power4-veccomplex): Correct latency.

View File

@ -1,3 +1,7 @@
2003-06-26 Neil Booth <neil@daikokuya.co.uk>
* misc.c (gnat_handle_option): Don't check for missing arguments.
2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
* utils.c (end_subprog_body): Adjust expand_function_end call.

View File

@ -220,7 +220,6 @@ gnat_parse_file (set_yydebug)
static int
gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
{
const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
char *q;
int i;
@ -229,12 +228,6 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
if (code == N_OPTS)
return 1;
if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
error ("missing argument to \"-%s\"", option->opt_text);
return 1;
}
switch (code)
{
default:

View File

@ -100,7 +100,7 @@ static size_t deferred_count, deferred_size;
/* Number of deferred options scanned for -include. */
static size_t include_cursor;
static void missing_arg (enum opt_code);
void missing_arg (enum opt_code);
static void set_Wimplicit (int);
static void print_help (void);
static void handle_OPT_d (const char *);
@ -130,7 +130,7 @@ static struct deferred_opt
/* Complain that switch OPT_INDEX expects an argument but none was
provided. */
static void
void
missing_arg (enum opt_code code)
{
const char *opt_text = cl_options[code].opt_text;
@ -257,12 +257,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
return 1;
}
if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
missing_arg (code);
return 1;
}
switch (code)
{
default:

View File

@ -1,3 +1,7 @@
Thu Jun 26 07:06:29 2003 Neil Booth <neil@daikokuya.co.uk>
* top.c (ffe_handle_option): Don't check for missing arguments.
Wed Jun 25 06:52:12 2003 Neil Booth <neil@daikokuya.co.uk>
* top.c (ffe_handle_option): Add missing break;.

View File

@ -175,19 +175,12 @@ ffe_init_options ()
int
ffe_handle_option (size_t scode, const char *arg, int value)
{
const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
/* Ignore file names. */
if (code == N_OPTS)
return 1;
if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
error ("missing argument to \"-%s\"", option->opt_text);
return 1;
}
switch (code)
{
default:

View File

@ -1,3 +1,7 @@
2003-06-26 Neil Booth <neil@daikokuya.co.uk>
* lang.c (java_handle_option): Don't check for missing arguments.
2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
* class.c (push_class): Use a location_t to save place.

View File

@ -265,19 +265,12 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
static int
java_handle_option (size_t scode, const char *arg, int value)
{
const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
/* Ignore file names. */
if (code == N_OPTS)
return 1;
if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
error ("missing argument to \"-%s\"", option->opt_text);
return 1;
}
switch (code)
{
default:

View File

@ -368,6 +368,12 @@ handle_option (char **argv, unsigned int lang_mask)
goto done;
}
if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
error ("missing argument to \"-%s\"", argv[0]);
goto done;
}
/* If the switch takes an integer, convert it. */
if (arg && (option->flags & CL_UINTEGER))
{

View File

@ -1,3 +1,7 @@
2003-06-26 Neil Booth <neil@daikokuya.co.uk>
* const-str-2.m: Update.
2003-06-25 Mark Mitchell <mark@codesourcery.com>
PR c++/10990

View File

@ -2,6 +2,6 @@
/* { dg-do compile } */
/* { dg-options "-fconstant-string-class=" } */
{ dg-error "no class name specified" "" { target *-*-* } 0 }
{ dg-error "no class name specified|missing argument" "" { target *-*-* } 0 }
void foo () {}