This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

GCC and OpenMP


I am confused. I thought GCC didn't support OpenMP until 4.2, but why my
4.1.2 GCC compiler recognizes the following OpenMP code. Is it safe to use?

#include <omp.h>
#include <stdio.h>
int main (int argc, char *argv[]) {
int id, nthreads;
#pragma omp parallel private (id)
{
    id = omp_get_thread_num ();
    printf (âHello World from thread %d\nâ, id);
    #pragma omp barrier
    if (id == 0) {
        nthreads = omp_get_num_threads ();
        printf (âThere are %d threads\nâ, nthreads);
    }
}
return 0;
}
-- 
View this message in context: http://www.nabble.com/GCC-and-OpenMP-tp17220268p17220268.html
Sent from the gcc - libstdc++ mailing list archive at Nabble.com.


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