This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++0x PATCH to add -fconstexpr-depth
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 18 Mar 2011 18:07:30 +0000 (UTC)
- Subject: Re: C++0x PATCH to add -fconstexpr-depth
- References: <4D7FAE65.3000505@redhat.com>
On Tue, 15 Mar 2011, Jason Merrill wrote:
> +/* Likewise, for constexpr function call evaluations. N3225 specifies a
> + minimum of 512. */
>
> +int max_constexpr_depth = 512;
Since all you're doing in the option handler is setting a global variable,
it's better to declare the option in the .opt file with
Var(max_constexpr_depth) Init(512). Then you don't need to define the
variable manually in c-common.c or declare it in c-common.h or have any
handler code for it in c-opts.c.
> +fconstexpr-depth=
> +C++ ObjC++ Joined RejectNegative UInteger
> +-constexpr-depth=<number> Specify maximum constexpr recursion depth
Typo in the help text: it's -fconstexpr-depth not -constexpr-depth.
--
Joseph S. Myers
joseph@codesourcery.com