On 30 May 2019 18:23:43 CEST, Qing Zhao <qing.z...@oracle.com> wrote:
>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

Typo inl vs inc.

Why isn't this a param?
Wouldn't a param ease range checking not to overflow the uint max and maybe 
automagically provide diagnostics for out of range input?

In the docs you mix "number" and "depth".

thanks,

> 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.z...@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.z...@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.z...@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.z...@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.

Reply via email to