This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
-fpack-struct fix for gcc-2.95.2
- To: gcc-patches at gcc dot gnu dot org
- Subject: -fpack-struct fix for gcc-2.95.2
- From: Christian Groessler <cpg at aladdin dot de>
- Date: Wed, 10 Nov 1999 15:17:38 +0100
- CC: cpg at aladdin dot de
Hi,
with gcc-2.95.2 the -fpack-struct command line parameter
is ignored.
The reason is, check_lang_option() in toplev.c didn't
check the complete independent options table, so the switch
was assumed to be a language depended one (-fpack triggered
this).
Here is a patch which fixes the problem for me:
--- gcc-2.95.2/gcc/toplev.c.org Thu Oct 21 09:01:37 1999
+++ gcc-2.95.2/gcc/toplev.c Sun Nov 7 02:55:43 1999
@@ -4683,7 +4683,8 @@
{
lang_independent_options * indep_options;
int len;
- long k;
+ int numopts;
+ long k;
char * space;
/* Ignore NULL entries. */
@@ -4713,8 +4714,14 @@
switch (option[1])
{
- case 'f': indep_options = f_options; break;
- case 'W': indep_options = W_options; break;
+ case 'f':
+ indep_options = f_options;
+ numopts = NUM_ELEM (f_options);
+ break;
+ case 'W':
+ indep_options = W_options;
+ numopts = NUM_ELEM (W_options);
+ break;
default: return 1;
}
@@ -4726,7 +4733,7 @@
if (option[0] == 'n' && option[1] == 'o' && option[2] == '-')
option += 3;
- for (k = NUM_ELEM (indep_options); k--;)
+ for (k = numopts; k--;)
{
if (!strcmp (option, indep_options[k].string))
{
Please reply with cc to me, as I'm not on this list....
regards,
chris