This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C vs. C++ parsers and the __attribute__ syntax
- From: "Ulrich Weigand" <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: jsm at polyomino dot org dot uk (Joseph S. Myers)
- Cc: weigand at i1 dot informatik dot uni-erlangen dot de (Ulrich Weigand), gcc at gcc dot gnu dot org
- Date: Wed, 27 Oct 2004 16:05:27 +0200 (CEST)
- Subject: Re: C vs. C++ parsers and the __attribute__ syntax
Joseph S. Myers wrote:
> "Attribute Syntax" in the manual, but there may well be bugs in both the
> documentation and the code.
Thanks, I overlooked this ...
> > typedef struct test * __attribute__ ((mode (SI))) test_ptr32;
>
> This is the proper way.
So it's a bug that the C++ parser doesn't handle this correctly?
I'll open a PR if so.
> > How would I declare a type like 'an SImode pointer to a
> > TImode integer'?
>
> typedef int (__attribute__((mode(TI))) (*__attribute__((mode(SI))) type));
This works for C; the C++ parser appears to go into an
endless loop when given this code ...
Without the outer pair of parentheses, the C compiler says
error: invalid pointer mode 'TI'
I guess this is because of the compatibility issues mentioned
in the last paragraph of the above manual page?
Thanks,
Ulrich
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de