GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
fortran

Permit comma between OpenMP directive and clause in Fortran

Fortran OpenMP now allows a comma separating directives from clauses, aligning with C/C++ syntax.

This change updates the Fortran front-end to permit an optional comma between an OpenMP directive and its first clause, mirroring syntax changes introduced in C/C++ and aligned with the OpenMP 5.2 standard. This improves syntactic flexibility and consistency across languages within GCC.

In Details

The gfc_match_omp_clauses function and related matching routines in fortran/openmp.cc were modified to accept a comma after the directive name before parsing clauses. This aligns Fortran's OpenMP syntax with C/C++ and the OpenMP 5.2 specification, as noted in libgomp's documentation.

For Context
OpenMP
An API that supports multi-platform shared-memory parallel programming in C, C++, and Fortran.
directive
In OpenMP, a statement that controls the parallelization or behavior of the code, typically starting with '#pragma omp' in C/C++ or '!$OMP' in Fortran.
clause
An option or parameter that modifies the behavior of an OpenMP directive, such as 'shared(var)' or 'schedule(static)'.
Filed Under: fortranopenmpsyntax