https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106670
Bug ID: 106670 Summary: [OpenMP][5.2] Warn for unknown '!$ompx' (!$omx') sentinels Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: diagnostic, openmp Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- OpenMP 5.2 reserves 'ompx' ('!$ompx') and for fixed-form Fortran !/*/c + $omx', used "for implementation-defined extensions to the OpenMP directives." For C/C++, those are diagnosed – either by default (-Wattributes) or with some flag (-Wunknown-pragmas), implied by -Wall: foo.C:1: warning: ignoring ‘#pragma ompx nothing2’ [-Wunknown-pragmas] 1 | #pragma ompx nothing2 | foo.C:2:1: warning: attribute ignored [-Wattributes] 2 | [[ompx::directive (nothing2)]]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ However, for Fortran, !$ompx is silently ignored. I think it would be useful to have some flag to warn about unknown '!$ompx' that can be silenced. We currently support: !$omp<space> → -fopenmp !$<space> → -fopenmp (Conditional Compilation Sentinel) !$acc<space> → -fopenacc !GCC$ → https://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-Compiler-Directives.html Questions: * What to warn for – only !$ompx/!$omx or more? * Which -W... to use for this? Especially when only warning for Examples: !$omp nothing2 ! only free form !$omx nothing2 ! only fixed form