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'. Bruno