Compiling the following code with "gcc -fopenmp -Wuninitialized -O",
I get a warning:  'i' may be used uninitialized in this function
--
int main() {
        int a = 0;
        int i;

#pragma omp parallel for firstprivate(a) lastprivate(a)
        for(i = 0; i < 10; i++) {
                a += i;
        }

        return a;
}


-- 
           Summary: incorrect warning when using firstprivate and
                    lastprivate clauses
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kuba at et dot pl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30421

Reply via email to