aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/gfortranspec.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2008-04-25 23:14:49 +0200
committerDaniel Franke <dfranke@gcc.gnu.org>2008-04-25 17:14:49 -0400
commitccc2ed871505aea3bb72601bafddd8ee207c6fe6 (patch)
treeab0258ef4021fd15bb79fb4dc786a3244d298772 /gcc/fortran/gfortranspec.c
parent9ae83b845687ff04cd89613745214f43b6700626 (diff)
downloadgcc-ccc2ed871505aea3bb72601bafddd8ee207c6fe6.zip
gcc-ccc2ed871505aea3bb72601bafddd8ee207c6fe6.tar.gz
gcc-ccc2ed871505aea3bb72601bafddd8ee207c6fe6.tar.bz2
re PR fortran/35156 ([patch] Deprecate -M<dir>)
2008-04-25 Tobias Burnus <burnus@net-b.de> Daniel Franke <franke.daniel@gmail.com> PR fortran/35156 * gfortranspec.c (lang_specific_driver): Deprecate -M option; fix ICE when "-M" is last argument and make "-M<dir>" work. * options.c (gfc_handle_module_path_options): Use -J instead of -M in error messages. * invoke.texi: Mark -M as depecated. Co-Authored-By: Daniel Franke <franke.daniel@gmail.com> From-SVN: r134680
Diffstat (limited to 'gcc/fortran/gfortranspec.c')
-rw-r--r--gcc/fortran/gfortranspec.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index 5f3a8d7..4a7d02f 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -429,18 +429,27 @@ For more information about these matters, see the file named COPYING\n\n"));
{
char *p;
+ fprintf (stderr, _("Warning: Using -M <directory> is deprecated, "
+ "use -J instead\n"));
if (argv[i][2] == '\0')
{
- p = XNEWVEC (char, strlen (argv[i + 1]) + 2);
- p[0] = '-';
- p[1] = 'J';
- strcpy (&p[2], argv[i + 1]);
- i++;
+ if (i+1 < argc)
+ {
+ p = XNEWVEC (char, strlen (argv[i + 1]) + 3);
+ p[0] = '-';
+ p[1] = 'J';
+ strcpy (&p[2], argv[i + 1]);
+ i++;
+ }
+ else
+ fatal ("argument to '%s' missing", argv[i]);
}
else
{
p = XNEWVEC (char, strlen (argv[i]) + 1);
- strcpy (p, argv[i]);
+ p[0] = '-';
+ p[1] = 'J';
+ strcpy (&p[2], argv[i] + 2);
}
append_arg (p);
continue;