Name of -Wdo-subscript option

Thomas König tk@tkoenig.net
Sun Dec 2 14:36:00 GMT 2018


Hi,

it seems that the name of the -Wdo-subscript option causes
some confusion.  We've had a couple of bug reports about
false positives.

Now, the option was working as advertised in the documentation,
which states

-Wdo-subscript'
      Warn if an array subscript inside a DO loop could lead to an
      out-of-bounds access even if the compiler can not prove that the
      statement is actually executed, in cases like
             real a(3)
             do i=1,4
               if (condition(i)) then
                 a(i) = 1.2
               end if
             end do
      This option is implied by `-Wextra'.

but maybe a more descriptive name would be better.

-Wdo-subscript-maybe?  -Wpossible-do-subscript-error?

I'd like to change this, but I do not have a really good
alternative name.  Suggestions?

Regards

	Thomas



More information about the Fortran mailing list