Hi, PR 90581 (provide an option to adjust the maximum depth of nested #include) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90581
is to add a new cpp option -fmax-inlcude-depth to set the maximum depth of
nested #include.
'-fmax-include-depth=DEPTH'
Set the maximum depth of the nested include. The default value is
200.
Please check the attached patch.
I have done bootstrap and regression test on X86, no any issue.
thanks a lot.
Qing.
gcc/ChangeLog:
2019-05-30 qing zhao <[email protected]>
* doc/cppopts.texi: Add document for -fmax-include-depth.
* doc/invoke.texi (Preprocessor Options): List -fmax-include-depth.
libcpp/ChangeLog:
2019-05-30 qing zhao <[email protected]>
* directives.c (do_include_common): Replace CPP_STACK_MAX with
CPP_OPTION (pfile, max_include_depth).
* include/cpplib.h (struct cpp_options): Add new field
max_include_depth.
* init.c (cpp_create_reader): Initiate new field max_include_depth.
* internal.h: Delete CPP_STACK_MAX.
gcc/c-family/ChangeLog:
2019-05-30 qing zhao <[email protected]>
* c-opts.c (c_common_handle_option): Handle -fmax-include-depth.
* c.opt: Add new option -fmax-include-depth.
gcc/testsuite/ChangeLog:
2019-05-30 qing zhao <[email protected]>
* c-c++-common/cpp/fmax-include-depth-1a.h: New test.
* c-c++-common/cpp/fmax-include-depth-1b.h: New test.
* c-c++-common/cpp/fmax-include-depth.c: New test.
0001-PR-preprocessor-90581.patch
Description: Binary data
