[patch, fortran] PR35156: deprecate -M

Tobias Burnus burnus@net-b.de
Fri Apr 25 11:57:00 GMT 2008


Daniel Franke wrote:
> 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.
>   

I believe you can also do the following change as in gfortranspec.c the 
argument "-M" is changed to "-J" and thus OPT_M should be not settable.


At the moment I do not see whether we allocate enough memory with 
XNEWVEC (I could not quickly find that function/macro). For "-J" + 
"<dir>" we need 2+strlen("<dir>") + 1 bytes to accomodate also for the 
'\0'. Thus there might be one byte missing for:

p = XNEWVEC (char, strlen (argv[i + 1]) + 2);
strcpy (&p[2], argv[i + 1]);

And for "-J<dir>" there might be two bytes missing:

p = XNEWVEC (char, strlen (argv[i]) + 1);
strcpy (&p[2], argv[i] + 2);


Tobias


Index: options.c
===================================================================
--- options.c   (Revision 134659)
+++ options.c   (Arbeitskopie)
@@ -718,7 +718,6 @@ gfc_handle_option (size_t scode, const c
       break;

     case OPT_J:
-    case OPT_M:
       gfc_handle_module_path_options (arg);
       break;



> 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



More information about the Fortran mailing list