+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>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
{
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;
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.
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}
{
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);
break;
case OPT_J:
- case OPT_M:
gfc_handle_module_path_options (arg);
break;
-
+
case OPT_fsign_zero:
gfc_option.flag_sign_zero = value;
break;
-
+
case OPT_ffpe_trap_:
gfc_handle_fpe_trap_option (arg);
break;