]> gcc.gnu.org Git - gcc.git/commitdiff
c-opts.c (missing_arg): Make non-static.
authorNeil Booth <neil@daikokuya.co.uk>
Thu, 26 Jun 2003 06:05:36 +0000 (06:05 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Thu, 26 Jun 2003 06:05:36 +0000 (06:05 +0000)
* 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

gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/misc.c
gcc/c-opts.c
gcc/f/ChangeLog
gcc/f/top.c
gcc/java/ChangeLog
gcc/java/lang.c
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/const-str-2.m

index ba4bde4af7686140af2f213a6ce9d3a83cfaed94..a27835d9ff6acbff4916f436eeffd5974b312afa 100644 (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.
index 1fd2a5b37552bb354e0534c7a9e55dde906a79f4..53ca9568be0b9d34ee5dad2c510a09057f6cbcde 100644 (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.
index 81bc3d948761bd92e0507b5eb456b5c0e0b4ff3f..4884fe9c2685c9b8f792543e30d32f2b2e82eca8 100644 (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:
index 7febbf315a1482f864154837187bd5d2be01e3c9..dbe7e903f0a9401bda8e6224e80504bfc1a86fd9 100644 (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:
index 8d1b3858f3a1de23896428ab42930b2440f04981..e1ac7ac5b914b1d56e42e573ef8c8f9b9509dbca 100644 (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;.
index 36cdaa6f821028457f01b2d47a5e1bb2ea54b008..359dd2b8d32d7fabfdc431a98b93309930f38124 100644 (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:
index 8c3aaad0e5fd92482e96a1dcbcb649fb0832173e..591b230a136fda76e2cfea8acbd0e150ae1e06c7 100644 (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.
index e389ddc665025c3720820cb3b31f139688510219..b8fc498da3c200592d1e77f4ee9f642de112d1dc 100644 (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:
index 2a805957abff01e9814deef49bdb891db81bbb08..a5e8297d1e4e902e2a4858e92313bc482c05a406 100644 (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))
        {
index c593d4e646d7cf27b05289a0dc63f360283f52b5..e5f954145af693a9de9a6715cb2907b7870efc18 100644 (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
index 779d40aff4e21907052567bdc68c59c43a35da8d..c406665c57617aec1e68376c575876ffba2e9a5c 100644 (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 () {}
This page took 0.152003 seconds and 5 git commands to generate.