Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V8028. The outer loop counter is...
menu mobile close menu
Additional information
toggle menu Contents

V8028. The outer loop counter is modified in the post statement of the inner loop. Perhaps the inner loop counter should be modified instead.

Jun 10 2026

The analyzer has detected that the outer loop counter in the post-statement of an inner loop is modified, which may indicate a logical error.

The simple version of this error looks like this:

for i := 0; i < M; i++ {
  for j := 0; j < N; i++ {
    a[i][j] = 0
  } 
}

In the inner loop, the i variable is incremented instead of j. The fixed code:

for i := 0; i < M; i++ {
  for j := 0; j < N; j++ {
    a[i][j] = 0
  }
}