This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Reversal of -fcheck options?


Hello again,

the trivial patch below enables reversal of checks as in:

gfortran -fcheck=all,nomem ...

etc.  If somebody wants to take it, please do so.

Thanks,
Harald

Index: gcc/fortran/options.c
===================================================================
--- gcc/fortran/options.c       (revision 232848)
+++ gcc/fortran/options.c       (working copy)
@@ -515,6 +515,15 @@
              result = 1;
              break;
            }
+         else if (optname[n] && pos > 2 && strncmp ("no", arg, 2) == 0
+                  && strncmp (optname[n], arg+2, pos-2) == 0)
+           {
+             gfc_option.rtcheck &= ~optmask[n];
+             arg += pos;
+             pos = 0;
+             result = 1;
+             break;
+           }
        }
       if (!result)
        gfc_fatal_error ("Argument to %<-fcheck%> is not valid: %s", arg);


On 01/26/16 22:06, Harald Anlauf wrote:
> Hello,
> 
> is there a way to revert a -fcheck=... option later in the command line?
> 
> The "old-style" variants allow e.g.
> 
> gfortran ... -fbounds-check ... -fno-bounds-check ...
> 
> but the documentation
> 
> https://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html#Code-Gen-Options
> 
> does not explain how to do this for -fcheck=bounds etc.
> (-fcheck=nobounds or -fcheck=no-bounds is not accepted).
> So it's probably not supported (yet).
> 
> Rationale: I'd like to use this in Makefiles to turn off
> checking options for individual files, e.g. because of PR69385.
> 
> Cheers,
> Harald
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]