This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71974] New: Warning: uninitialized variable with OpenMP nested loops


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71974

            Bug ID: 71974
           Summary: Warning: uninitialized variable with OpenMP nested
                    loops
           Product: gcc
           Version: 4.8.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: register at rgug dot ch
  Target Milestone: ---

I used the collapse clause of OpenMP to work with a doubly nested loop as
follows:
unsigned int iMax(10);
#pragma omp parallel for schedule(dynamic,1) shared(iMax) private(i, j)
collapse(2)
for( i = 1; i < 4; i++ )
{
        for( j = 0; j <= iMax - i; j++ )
        {
        }
}

The above code, which seems to work, create the following warning:
warning: ‘i’ is used uninitialized in this function [-Wuninitialized]

Is it normal?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]