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