https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116935

            Bug ID: 116935
           Summary: [OpenMP] Suggest '<omp.h>' header inclusion for
                    OpenMP's omp_* routines and other definitions
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: diagnostic, openmp
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

It would be useful to add #include hints when using omp_… without having a
   #include <omp.h>

It could be based on the reserved omp_ (ompx_?) prefix for the identifier
instead of listening all combinations.

→ Actually, likewise for Fortran (omp_lib), if it is just based on the prefix?

As that would be guarded by -fopenmp, checking for startswith('omp_') should be
safe.

* * *

Clang has the following – interestingly, it suddenly requires the handle type
not the enum value that the user entered, which seems to be slightly bogus.

    4 | #pragma omp allocate(A1) align(128) allocator(omp_default_mem_alloc)
      |                                               ^
allocate-static.c:4:47: error: 'omp_allocator_handle_t' type not found; include
<omp.h>

Reply via email to