On Fri, 2019-05-24 at 11:59 -0500, Qing Zhao wrote:
> Hi, 
> 
> in order to fix PR90581: (provide an option to adjust the maximum
> depth of nested #include)
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90581 <https://gcc.gnu.o
> rg/bugzilla/show_bug.cgi?id=90581>
> 
> we need to add a new option to preprocessor.  where should I put this
> option?
> 
> I tried to add a new option into:
> 
> gcc/c-family/c.opt
> 
> [qinzhao@localhost c-family]$ git diff c.opt
> diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
> index 046d489..4f237b6 100644
> --- a/gcc/c-family/c.opt
> +++ b/gcc/c-family/c.opt
> @@ -1598,6 +1598,10 @@ flocal-ivars
>  ObjC ObjC++ Var(flag_local_ivars) Init(1)
>  Allow access to instance variables as if they were local
> declarations within instance method implementati
>  
> +finclude-nest-limit=
> +C ObjC C++ ObjC++ Joined RejectNegative UInteger
> Var(include_nest_limit) Init(200)
> +Set the maximum number of depth of nested #include.
> +
> 
> However, don’t know how to refer this new variable
> “include_nest_limit” from libcpp.
> 

You probably want to add a new field to cpp_options, and copy over the
value from the GCC options to the new field; see e.g.
c_common_handle_option where various cases write to fields of cpp_opts.

Hope this is helpful
Dave

Reply via email to