Compiling the following code with "-fopenmp -O -Wall" yields a bogus warning (happens with C and C++):
====================================== void foo() { int i; #pragma omp threadprivate(i) #pragma omp parallel sections { #pragma omp section { i = 0; ++i; } } } ====================================== bug.c: In function 'foo': bug.c:11: warning: 'i' is used uninitialized in this function -- Summary: [gomp] Bogus "is used uninitialized" warning Product: gcc Version: unknown Status: UNCONFIRMED Keywords: diagnostic, openmp Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24612