Name of -Wdo-subscript option

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Name of -Wdo-subscript option

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
Reply | Threaded
Open this post in threaded view
|

Re: Name of -Wdo-subscript option

jerry DeLisle-3
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
Reply | Threaded
Open this post in threaded view
|

Re: Name of -Wdo-subscript option

Dominique d'Humières-2
In reply to this post by Thomas König
> Perhaps -Wdo-index-maybe?

maybe what?

-Windex-maybe-out-of-bounds?

I really hate warnings!-(

Dominique

Reply | Threaded
Open this post in threaded view
|

Re: Name of -Wdo-subscript option

Nicolas Koenig-2
On 2 December 2018 16:45:11 CET, "Dominique d'Humières" <[hidden email]> wrote:
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Name of -Wdo-subscript option

Katherine Holcomb-2
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.

On 12/2/18, 11:18 AM, "[hidden email] on behalf of Nicolas Koenig" <[hidden email] on behalf of [hidden email]> wrote:

    On 2 December 2018 16:45:11 CET, "Dominique d'Humières" <[hidden email]> wrote:
    >> 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