This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] PR35156: deprecate -M
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Apr 2008 23:38:47 +0200
- Subject: [patch, fortran] PR35156: deprecate -M
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:mime-version:content-disposition:content-type:message-id; bh=QWe/pbUGaxMgos+E9bzXJTP7LUFQd6Hh7OJF9ZlFVvw=; b=ex6MWjAEnzWB0rb6RJJES3pv6uKqIYXtbtPhprto66LRsuhSJSr/7oeEfTtBUDJHpZo0U9+tzzSjM9EpYmrXpt2NY/OIDgz5A70lefR0jykwR+9V3vcsl/qRbTRnjI2KMIMmGRrj6kpjV+Vm0lRAyZ3t0yDKVzYZwEm2RkH0oSg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-disposition:content-type:message-id; b=VuVw7rdoFfMRaeQeXkBAN0IkHKXGNNNd/V52jZVREqKEStjizsM1k6bPiLZFyhgKX2/GhZzBNnMOqbBIOAQYjOfMtx5Nru6dVu16VA8M1jtxJhckccuar1m+JaOnUC/Z/A8wu3cTLLDpFO20chltbUDts4k3BoJQVioo3VHFGBE=
A very similar patch was already ok'ed [1], I just cleaned it up a bit. If
there are no objections, I'll commit it on Tobias' behalf in 24 hours.
:ADDPATCH fortran:
2008-01-29 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.
Regression tested on i686-pc-linux-gnu.
Regards
Daniel
[1] http://gcc.gnu.org/ml/fortran/2008-01/msg00366.html
Index: gfortranspec.c
===================================================================
--- gfortranspec.c (revision 134566)
+++ gfortranspec.c (working copy)
@@ -429,18 +429,27 @@ For more information about these matters
{
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]) + 2);
+ 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;
Index: options.c
===================================================================
--- options.c (revision 134566)
+++ options.c (working copy)
@@ -391,10 +391,7 @@ gfc_handle_module_path_options (const ch
{
if (gfc_option.module_dir != NULL)
- gfc_fatal_error ("gfortran: Only one -M option allowed");
-
- if (arg == NULL)
- gfc_fatal_error ("gfortran: Directory required after -M");
+ gfc_fatal_error ("gfortran: Only one -J option allowed");
gfc_option.module_dir = (char *) gfc_getmem (strlen (arg) + 2);
strcpy (gfc_option.module_dir, arg);
Index: invoke.texi
===================================================================
--- invoke.texi (revision 134566)
+++ invoke.texi (working copy)
@@ -633,10 +633,10 @@ compiled modules are required by a @code
gcc,Using the GNU Compiler Collection (GCC)}, for information on the
@option{-I} option.
-@item -M@var{dir}
@item -J@var{dir}
-@opindex @code{M}@var{dir}
+@item -M@var{dir}
@opindex @code{J}@var{dir}
+@opindex @code{M}@var{dir}
@cindex paths, search
@cindex module search path
This option specifies where to put @file{.mod} files for compiled modules.
@@ -645,8 +645,7 @@ statement.
The default is the current directory.
-@option{-J} is an alias for @option{-M} to avoid conflicts with existing
-GCC options.
+@option{-M} is deprecated to avoid conflicts with existing GCC options.
@item -fintrinsic-modules-path @var{dir}
@opindex @code{fintrinsic-modules-path} @var{dir}