From: Eric Botcazou Date: Mon, 14 Feb 2011 19:16:34 +0000 (+0000) Subject: misc.c (gnat_init_options): Do not concatenate -I and its argument, except for the... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=400a2d24373671cfd8de8c2a2c6d5c788d76b3d5;p=gcc.git misc.c (gnat_init_options): Do not concatenate -I and its argument, except for the special -I- switch. * gcc-interface/misc.c (gnat_init_options): Do not concatenate -I and its argument, except for the special -I- switch. From-SVN: r170150 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cf72091f9b4..defad830e15 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2011-02-14 Eric Botcazou + + * gcc-interface/misc.c (gnat_init_options): Do not concatenate -I and + its argument, except for the special -I- switch. + 2011-02-12 Gerald Pfeifer * gnat_ugn.texi (Compiling Different Versions of Ada): Update diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 360ebab8aed..4f7a5e1da1d 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -195,13 +195,12 @@ gnat_init_options (unsigned int decoded_options_count, || num_elements == 0) continue; - if (decoded_options[i].opt_index == OPT_I) - { - gcc_assert (num_elements == 2); - save_argv[save_argc++] - = concat (decoded_options[i].canonical_option[0], - decoded_options[i].canonical_option[1], NULL); - } + /* Deal with -I- specially since it must be a single switch. */ + if (decoded_options[i].opt_index == OPT_I + && num_elements == 2 + && decoded_options[i].canonical_option[1][0] == '-' + && decoded_options[i].canonical_option[1][1] == '\0') + save_argv[save_argc++] = "-I-"; else { gcc_assert (num_elements >= 1 && num_elements <= 2); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 82e8ba34c01..9d200a419af 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-02-14 Eric Botcazou + + * gnat.dg/include.adb: New test. + 2011-02-14 Janus Weil PR fortran/47728 diff --git a/gcc/testsuite/gnat.dg/include.adb b/gcc/testsuite/gnat.dg/include.adb new file mode 100644 index 00000000000..ec183c723b7 --- /dev/null +++ b/gcc/testsuite/gnat.dg/include.adb @@ -0,0 +1,4 @@ +-- { dg-do compile } */ +-- { dg-options "-cargs -I -gnatws" } + +-- { dg-error "search directory missing" "" { target *-*-* } 0 }