[PATCH][Preprocessor]patch to fix PR 90581

Qing Zhao qing.zhao@oracle.com
Thu May 30 16:26:00 GMT 2019


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  <qing.zhao@oracle.com>

        * 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  <qing.zhao@oracle.com>

        * 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  <qing.zhao@oracle.com>

        * 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  <qing.zhao@oracle.com>

        * 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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PR-preprocessor-90581.patch
Type: application/octet-stream
Size: 6536 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190530/41f331fc/attachment.obj>


More information about the Gcc-patches mailing list