From: Neil Booth Date: Thu, 26 Jun 2003 06:05:36 +0000 (+0000) Subject: c-opts.c (missing_arg): Make non-static. X-Git-Tag: releases/gcc-3.4.0~5467 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9eee5e726de1e5d11bc77e0f2ae05c9c0c0916b6;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba4bde4af768..a27835d9ff6a 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 1fd2a5b37552..53ca9568be0b 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 81bc3d948761..4884fe9c2685 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 7febbf315a14..dbe7e903f0a9 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 8d1b3858f3a1..e1ac7ac5b914 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 36cdaa6f8210..359dd2b8d32d 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 8c3aaad0e5fd..591b230a136f 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 e389ddc66502..b8fc498da3c2 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 2a805957abff..a5e8297d1e4e 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 c593d4e646d7..e5f954145af6 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 779d40aff4e2..c406665c5761 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 () {}