From: Tobias Burnus Date: Fri, 25 Apr 2008 21:14:49 +0000 (+0200) Subject: re PR fortran/35156 ([patch] Deprecate -M) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccc2ed871505aea3bb72601bafddd8ee207c6fe6;p=platform%2Fupstream%2Fgcc.git re PR fortran/35156 ([patch] Deprecate -M) 2008-04-25 Tobias Burnus Daniel Franke PR fortran/35156 * gfortranspec.c (lang_specific_driver): Deprecate -M option; fix ICE when "-M" is last argument and make "-M" 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 From-SVN: r134680 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4de64f1..b469063 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,14 @@ +2008-04-25 Tobias Burnus + Daniel Franke + + PR fortran/35156 + * gfortranspec.c (lang_specific_driver): Deprecate + -M option; fix ICE when "-M" is last argument and + make "-M" 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 Francois-Xavier Coudert 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 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; diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 2bac12c..712aa21 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -633,10 +633,10 @@ compiled modules are required by a @code{USE} statement. 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} diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 06a4622..a1020bf 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -391,10 +391,7 @@ gfc_handle_module_path_options (const char *arg) { 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); @@ -718,14 +715,13 @@ gfc_handle_option (size_t scode, const char *arg, int value) 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;