Due to non-standard code in the supplied openMP header file omp_lib.h compiling with standards checking on results in errors due to the include file and not the users code:
Wot now ? uname -a Linux kingswood.nag.co.uk 2.6.27.25-78.2.56.fc9.i686 #1 SMP Thu Jun 18 12:47:50 EDT 2009 i686 i686 i386 GNU/Linux Wot now ? ~/Download/usr/local/gfortran/bin/gfortran --version GNU Fortran (GCC) 4.5.0 20090817 (experimental) [trunk revision 150822] Copyright (C) 2009 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING Wot now ? cat omp.f90 Program annoying Include 'omp_lib.h' End Program annoying Wot now ? ~/Download/usr/local/gfortran/bin/gfortran -fopenmp -std=f95 omp.f90 omp_lib.h:45.15: Included at omp.f90:3: logical*4 omp_get_dynamic, omp_get_nested 1 Error: Nonstandard type declaration LOGICAL*4 at (1) omp_lib.h:47.15: Included at omp.f90:3: logical*4 omp_test_lock, omp_in_parallel 1 Error: Nonstandard type declaration LOGICAL*4 at (1) omp_lib.h:50.15: Included at omp.f90:3: integer*4 omp_get_max_threads, omp_get_num_procs 1 Error: Nonstandard type declaration INTEGER*4 at (1) omp_lib.h:52.15: Included at omp.f90:3: integer*4 omp_get_num_threads, omp_get_thread_num 1 Error: Nonstandard type declaration INTEGER*4 at (1) omp_lib.h:54.15: Included at omp.f90:3: integer*4 omp_test_nest_lock 1 Error: Nonstandard type declaration INTEGER*4 at (1) omp_lib.h:64.15: Included at omp.f90:3: integer*4 omp_get_thread_limit, omp_get_max_active_levels 1 Error: Nonstandard type declaration INTEGER*4 at (1) omp_lib.h:65.15: Included at omp.f90:3: integer*4 omp_get_level, omp_get_ancestor_thread_num 1 Error: Nonstandard type declaration INTEGER*4 at (1) omp_lib.h:66.15: Included at omp.f90:3: integer*4 omp_get_team_size, omp_get_active_level 1 Error: Nonstandard type declaration INTEGER*4 at (1) Wot now ? The nett result is it is difficult to check for non-standard code in programs that include omp_lib.h, which is irritating if portability is extremly important to you. ( Yes, I know there is a work around by using the module rather than including the file, but both should work ! ) Actually this is a more general problem as MPI include files often have similar non-standard code, with the same resulting irritation. What would be nice is some way to say that you wish to ignore all problems caused by a given set of include files. However it would also be nice to fix the include file ! -- Summary: openMP include file causes errors when compiling with standards checking Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ian dot bush at nag dot co dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41099