This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Convert ada/ to opts.c
- From: Andreas Jaeger <aj at suse dot de>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Jun 2003 07:47:56 +0200
- Subject: Re: Convert ada/ to opts.c
- References: <20030611201836.GS28612@daikokuya.co.uk>
I just created the following patch to fix these two problems:
/cvs/gcc/gcc/ada/misc.c: In function `gnat_handle_option':
/cvs/gcc/gcc/ada/misc.c:249: warning: assignment discards qualifiers from pointer target type
/cvs/gcc/gcc/ada/misc.c:275: warning: enumeration value `N_OPTS' not handled in switch
Ok to commit? I'm bootstrapping right now on i686-linux-gnu but the
file compiles without warnings again,
Andreas
2003-06-12 Andreas Jaeger <aj@suse.de>
* misc.c (gnat_handle_option): Handle N_OPTS in switch.
(gnat_handle_option): Fix handling of -fRTS.
============================================================
Index: gcc/ada/misc.c
--- gcc/ada/misc.c 11 Jun 2003 20:23:02 -0000 1.52
+++ gcc/ada/misc.c 12 Jun 2003 05:44:16 -0000
@@ -7,7 +7,7 @@
* C Implementation File *
* *
* *
- * Copyright (C) 1992-2002 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -224,6 +224,7 @@ gnat_handle_option (size_t scode, const
enum opt_code code = (enum opt_code) scode;
char *q;
int i;
+ const char *strRTS = "-fRTS";
/* Ignore file names. */
if (code == N_OPTS)
@@ -246,7 +247,9 @@ gnat_handle_option (size_t scode, const
break;
case OPT_fRTS:
- gnat_argv[gnat_argc] = "-fRTS";
+ q = xmalloc (strlen (strRTS) + 1);
+ strcpy (q, strRTS);
+ gnat_argv[gnat_argc] = q;
gnat_argc++;
break;
@@ -272,6 +275,11 @@ gnat_handle_option (size_t scode, const
break;
}
break;
+ case N_OPTS:
+ /* Handled above already but added here to avoid compile error since
+ all switches need to be handled in the switch. */
+ break;
+
}
return 1;
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj