Name of -Wdo-subscript option

Jerry DeLisle jvdelisle@charter.net
Sun Dec 2 15:22:00 GMT 2018


On 12/2/18 6:36 AM, Thomas König wrote:
> 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
> 

Perhaps -Wdo-index-maybe?

Jerry



More information about the Fortran mailing list