This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c/c++ (rfa)] fix 32455
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Richard Henderson" <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Feb 2008 21:24:14 +0100
- Subject: Re: [c/c++ (rfa)] fix 32455
- References: <20080206180345.GB17948@redhat.com>
On Feb 6, 2008 7:03 PM, Richard Henderson <rth@redhat.com> wrote:
> In fixing 32455, I agree with Richard Guenther that probably
> the best way to fix the bug is simply to prevent users from
> re-declaring __builtin_ functions with different signatures.
> Indeed, the easiest way appears to be to prevent them from
> doing pretty much anything with the __builtin_ namespace.
>
> This is an RFA for the C++ side, because while the testcase
> I have appears to work, I've no idea what other kind of side
> effects may be involved on that side.
I think this is a sensible solution. But we should probably add
documentation and say these identifiers are reserved.
Also,
> --- gcc/testsuite/gcc.dg/pr32455-2.c (revision 132159)
> +++ gcc/testsuite/gcc.dg/pr32455-2.c (local)
> @@ -0,0 +1,17 @@
> +/* { dg-do compile } */
> +
> +struct __builtin_struct
> +{
> + int x;
> + int __builtin_field; /* { dg-error "reserved" } */
> +};
We reject __builtin_field, but not __builtin_struct? What happens
if you re-declare the __builtin_va_list type?
Thanks,
Richard.