Discussion:
Name of -Wdo-subscript option
Thomas König
2018-12-02 14:36:45 UTC
Permalink
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
Jerry DeLisle
2018-12-02 15:22:03 UTC
Permalink
Post by Thomas König
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
Dominique d'Humières
2018-12-02 15:45:11 UTC
Permalink
Post by Jerry DeLisle
Perhaps -Wdo-index-maybe?
maybe what?

-Windex-maybe-out-of-bounds?

I really hate warnings!-(

Dominique
Nicolas Koenig
2018-12-02 16:17:44 UTC
Permalink
Post by Dominique d'Humières
Post by Jerry DeLisle
Perhaps -Wdo-index-maybe?
maybe what?
-Windex-maybe-out-of-bounds?
I really hate warnings!-(
Dominique
Hi everyone,

maybe -Wpossible-out-of-bounds-index? That would pretty much describe what this option tries to diagnose.

Nicolas
Holcomb, Katherine A (kah3f)
2018-12-02 22:58:09 UTC
Permalink
I have no good suggestions to offer but since "Windex" is the name of a famous and venerable American cleaning product (to the point that nearly all glass cleaners are colloquially called "windex") I'd be predisposed to thinkg that something more like -Wdo-index would work better.
Post by Dominique d'Humières
Post by Jerry DeLisle
Perhaps -Wdo-index-maybe?
maybe what?
-Windex-maybe-out-of-bounds?
I really hate warnings!-(
Dominique
Hi everyone,

maybe -Wpossible-out-of-bounds-index? That would pretty much describe what this option tri
Loading...