Commit ccc2ed87 by Tobias Burnus Committed by Daniel Franke

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
parent 9ae83b84
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.
2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
......
...@@ -429,18 +429,27 @@ For more information about these matters, see the file named COPYING\n\n")); ...@@ -429,18 +429,27 @@ For more information about these matters, see the file named COPYING\n\n"));
{ {
char *p; char *p;
fprintf (stderr, _("Warning: Using -M <directory> is deprecated, "
"use -J instead\n"));
if (argv[i][2] == '\0') if (argv[i][2] == '\0')
{ {
p = XNEWVEC (char, strlen (argv[i + 1]) + 2); if (i+1 < argc)
p[0] = '-'; {
p[1] = 'J'; p = XNEWVEC (char, strlen (argv[i + 1]) + 3);
strcpy (&p[2], argv[i + 1]); p[0] = '-';
i++; p[1] = 'J';
strcpy (&p[2], argv[i + 1]);
i++;
}
else
fatal ("argument to '%s' missing", argv[i]);
} }
else else
{ {
p = XNEWVEC (char, strlen (argv[i]) + 1); 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); append_arg (p);
continue; continue;
......
...@@ -633,10 +633,10 @@ compiled modules are required by a @code{USE} statement. ...@@ -633,10 +633,10 @@ compiled modules are required by a @code{USE} statement.
gcc,Using the GNU Compiler Collection (GCC)}, for information on the gcc,Using the GNU Compiler Collection (GCC)}, for information on the
@option{-I} option. @option{-I} option.
@item -M@var{dir}
@item -J@var{dir} @item -J@var{dir}
@opindex @code{M}@var{dir} @item -M@var{dir}
@opindex @code{J}@var{dir} @opindex @code{J}@var{dir}
@opindex @code{M}@var{dir}
@cindex paths, search @cindex paths, search
@cindex module search path @cindex module search path
This option specifies where to put @file{.mod} files for compiled modules. This option specifies where to put @file{.mod} files for compiled modules.
...@@ -645,8 +645,7 @@ statement. ...@@ -645,8 +645,7 @@ statement.
The default is the current directory. The default is the current directory.
@option{-J} is an alias for @option{-M} to avoid conflicts with existing @option{-M} is deprecated to avoid conflicts with existing GCC options.
GCC options.
@item -fintrinsic-modules-path @var{dir} @item -fintrinsic-modules-path @var{dir}
@opindex @code{fintrinsic-modules-path} @var{dir} @opindex @code{fintrinsic-modules-path} @var{dir}
......
...@@ -391,10 +391,7 @@ gfc_handle_module_path_options (const char *arg) ...@@ -391,10 +391,7 @@ gfc_handle_module_path_options (const char *arg)
{ {
if (gfc_option.module_dir != NULL) if (gfc_option.module_dir != NULL)
gfc_fatal_error ("gfortran: Only one -M option allowed"); gfc_fatal_error ("gfortran: Only one -J option allowed");
if (arg == NULL)
gfc_fatal_error ("gfortran: Directory required after -M");
gfc_option.module_dir = (char *) gfc_getmem (strlen (arg) + 2); gfc_option.module_dir = (char *) gfc_getmem (strlen (arg) + 2);
strcpy (gfc_option.module_dir, arg); strcpy (gfc_option.module_dir, arg);
...@@ -718,14 +715,13 @@ gfc_handle_option (size_t scode, const char *arg, int value) ...@@ -718,14 +715,13 @@ gfc_handle_option (size_t scode, const char *arg, int value)
break; break;
case OPT_J: case OPT_J:
case OPT_M:
gfc_handle_module_path_options (arg); gfc_handle_module_path_options (arg);
break; break;
case OPT_fsign_zero: case OPT_fsign_zero:
gfc_option.flag_sign_zero = value; gfc_option.flag_sign_zero = value;
break; break;
case OPT_ffpe_trap_: case OPT_ffpe_trap_:
gfc_handle_fpe_trap_option (arg); gfc_handle_fpe_trap_option (arg);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment