This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [c/c++ (rfa)] fix 32455


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]