http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57423
Bug ID: 57423 Summary: Incorrect keyword argument names in Fortran OpenMP procedure interfaces in omp_lib Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: spam.brian.taylor at gmail dot com Created attachment 30197 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30197&action=edit Test omp_lib keyword arguments The argument names of many of the the OpenMP procedure interfaces in gfortran's omp_lib.f90 differ from those listed in the OpenMP 3.0 standard. Starting with Fortran 90, dummy argument names in procedures with explicit interfaces are, in a sense, part of the API. Section 3.1 of the OpenMP 3.0 standard defines the various procedure interfaces. For example, one should be able write code like: call omp_set_num_threads(num_threads=1) This does not work with the present implementation in omp_lib.f90, as the interface is declared with an argument named "set" rather than "num_threads". Page 108, line 18 of the OpenMP 3.0 standard states, "The OpenMP Fortran API runtime library routines are external procedures." However, lines 20-23 read, "Interface declarations for the OpenMP Fortran runtime library routines described in this chapter shall be provided in the form of a Fortran include file named omp_lib.h or a Fortran 90 module named omp_lib. It is implementation defined whether the include file or the module file (or both) is provided." It is perhaps arguable, then, if it is intended for keyword arguments to be part of the OpenMP Fortran interface, but if explicit interfaces are to be declared in omp_lib.f90, it can't hurt to make the implementation match up more closely with the standard. Of the procedures that take arguments declared in omp_lib.f90, only omp_set_schedule, omp_set_max_active_levels, omp_get_ancestor_thread_num, and omp_get_team_size have correct argument name(s). The attached test case illustrates these problems. It should be compiled with: gfortran -fopenmp -c openmp_keyword_arguments.F90