diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 23 |
2 files changed, 24 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 86226af..020746b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2010-09-03 Joseph Myers <joseph@codesourcery.com> + + PR ada/45499 + * gcc-interface/misc.c (gnat_init_options): Allow options with + empty canonical form. Generate a single save_argv element from -I + options. + 2010-08-30 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/utils.c (gnat_pushdecl): Remove test for PARM_DECLs. diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index c104e29..080e988 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -273,13 +273,24 @@ gnat_init_options (unsigned int decoded_options_count, for (i = 0; i < decoded_options_count; i++) { if (decoded_options[i].errors - || decoded_options[i].opt_index == OPT_SPECIAL_unknown) + || decoded_options[i].opt_index == OPT_SPECIAL_unknown + || decoded_options[i].canonical_option_num_elements == 0) continue; - gcc_assert (decoded_options[i].canonical_option_num_elements >= 1 - && decoded_options[i].canonical_option_num_elements <= 2); - save_argv[save_argc++] = decoded_options[i].canonical_option[0]; - if (decoded_options[i].canonical_option_num_elements >= 2) - save_argv[save_argc++] = decoded_options[i].canonical_option[1]; + if (decoded_options[i].opt_index == OPT_I) + { + gcc_assert (decoded_options[i].canonical_option_num_elements == 2); + save_argv[save_argc++] + = concat (decoded_options[i].canonical_option[0], + decoded_options[i].canonical_option[1], NULL); + } + else + { + gcc_assert (decoded_options[i].canonical_option_num_elements >= 1 + && decoded_options[i].canonical_option_num_elements <= 2); + save_argv[save_argc++] = decoded_options[i].canonical_option[0]; + if (decoded_options[i].canonical_option_num_elements >= 2) + save_argv[save_argc++] = decoded_options[i].canonical_option[1]; + } } save_argv[save_argc] = NULL; |