#include_next Directive

This page was translated by a robot.

This directive is a GCC specific directive which is needed to include the second file found in the search path. Since this directive is GCC-specific, where it is used primarily with system header files, the directive is #include_nextNOT recommended unless it is clear what it does.

#include_next "filename"

Details

#include_nextAs with the #includedirective , the locations entered in the system-wide search path for include files are searched in order, but the first occurrence of the file is skipped. Only the second file with the same name found will be embedded. Using this directive, a programmer can inject a file into the search path that has the same name as an original file (e.g. stdio.h). Within the injected file, the programmer can #include_nextinclude the original file.

Unlike the directive, the #include_nextdirective does not distinguish #includebetween double quotes " "and greater-less characters <>, but always expects double quotes and trailing characters " ".

If the directive is used in the file containing the main function, the compiler issues an #include_next in primary source file warning.