[Bug c/82892] New: Spelling hints do not take into account missing compiler options (e.g. -fopenmp)

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Tue Nov 7 21:57:00 GMT 2017


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

            Bug ID: 82892
           Summary: Spelling hints do not take into account missing
                    compiler options (e.g. -fopenmp)
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gmx dot de
  Target Milestone: ---

The nice diagnostics feature of spelling hints made me scratch my head
until I noticed that I forgot to provide the flag -fopenmp:

% cat print_openmp_version.c
#include <stdio.h>

int
main ()
{
  printf ("_OPENMP = %d\n", _OPENMP);
  return 0;
}

% gcc-7 print_openmp_version.c
print_openmp_version.c: In function 'main':
print_openmp_version.c:6:29: error: '_OPENMP' undeclared (first use in this
function); did you mean '_G_OPEN64'?
   printf ("_OPENMP = %d\n", _OPENMP);
                             ^~~~~~~
                             _G_OPEN64
print_openmp_version.c:6:29: note: each undeclared identifier is reported only
once for each function it appears in

% gcc-7 print_openmp_version.c -fopenmp

Would it make sense to extend this feature to appropriate compilation flags?


More information about the Gcc-bugs mailing list