[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using gnulib with -pedantic, I get many warnings about #include_next

From: Bruno Haible
Subject: Re: Using gnulib with -pedantic, I get many warnings about #include_next
Date: Mon, 25 Aug 2008 03:13:35 +0200
User-agent: KMail/1.5.4

Eric Blake wrote:
> But obviously, glibc has some way of marking a header file as a system
> header, so that the use of extensions such as #include_next do not trigger
> gcc -pedantic warnings.  Is there a #pragma that glibc uses to do that?
> And should gnulib do the same?

The code that emits this warning in gcc is this:

static void
directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented)
  /* Issue -pedantic warnings for extensions.  */
  if (CPP_PEDANTIC (pfile)
      && ! pfile->state.skipping
      && dir->origin == EXTENSION)
    cpp_error (pfile, CPP_DL_PEDWARN, "#%s is a GCC extension", dir->name);

Reuben has chosen to set CPP_PEDANTIC to true, so in order to get rid of the
warning, he needs to make  dir->origin == EXTENSION  evaluate to false.
This means, specify the directory containing the built gnulib header files
with '-isystem' instead of '-I'.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]