diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba4bde4af76..a27835d9ff6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-06-26 Neil Booth + + * 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 * config/rs6000/power4.md (power4-veccomplex): Correct latency. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1fd2a5b3755..53ca9568be0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2003-06-26 Neil Booth + + * misc.c (gnat_handle_option): Don't check for missing arguments. + 2003-06-20 Nathan Sidwell * utils.c (end_subprog_body): Adjust expand_function_end call. diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index 81bc3d94876..4884fe9c268 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -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: diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 7febbf315a1..dbe7e903f0a 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -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: diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 8d1b3858f3a..e1ac7ac5b91 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,7 @@ +Thu Jun 26 07:06:29 2003 Neil Booth + + * top.c (ffe_handle_option): Don't check for missing arguments. + Wed Jun 25 06:52:12 2003 Neil Booth * top.c (ffe_handle_option): Add missing break;. diff --git a/gcc/f/top.c b/gcc/f/top.c index 36cdaa6f821..359dd2b8d32 100644 --- a/gcc/f/top.c +++ b/gcc/f/top.c @@ -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: diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 8c3aaad0e5f..591b230a136 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2003-06-26 Neil Booth + + * lang.c (java_handle_option): Don't check for missing arguments. + 2003-06-20 Nathan Sidwell * class.c (push_class): Use a location_t to save place. diff --git a/gcc/java/lang.c b/gcc/java/lang.c index e389ddc6650..b8fc498da3c 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -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: diff --git a/gcc/opts.c b/gcc/opts.c index 2a805957abf..a5e8297d1e4 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -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)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c593d4e646d..e5f954145af 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-06-26 Neil Booth + + * const-str-2.m: Update. + 2003-06-25 Mark Mitchell PR c++/10990 diff --git a/gcc/testsuite/objc.dg/const-str-2.m b/gcc/testsuite/objc.dg/const-str-2.m index 779d40aff4e..c406665c576 100644 --- a/gcc/testsuite/objc.dg/const-str-2.m +++ b/gcc/testsuite/objc.dg/const-str-2.m @@ -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 () {}