This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Using custom qualifiers like __THROW
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: snodx at hotmail dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: 17 Jul 2003 13:51:18 -0700
- Subject: Re: Using custom qualifiers like __THROW
- References: <2023665.1058448012708.JavaMail.nobody@Computer6>
snodx@hotmail.com writes:
> Thanx michal017@centrum.sk, Rupert Wood and others for your responses
>
> Eljay Love-Jensen wrote:
>
> >Your macro magic expand to...
>
> >int square_func(int) void snodx() { return; }; //LINE 5
>
> >...which is not valid C or C++. If you want, you could make
> your own computer programming language where this is a valid syntax.
>
> If square_func is not valid C or C++ syntax then the same property of invalid
> C/C++ syntax should apply to
>
> extern int fcloseall(void) __THROW;
>
> which should expand to
>
> extern int fcloseall(void) throw();
I don't think you are looking closely enough at the code. If c is
being compiled, __THROW expands to nothing.
>
> When I declare square_func(int) as
>
> int square_func(int) __THROW;
>
> then the code compiles fine with gcc
>
> "m" <michal017@centrum.sk> wrote:
>
> >Isn't throw() or throw a reserved keyword?
> >You can't override int or char or bool or void.. so you can't override throw.. ;)
> >That's how I understand it..
>
> My question is according to the 'C' language valid forms of function declarations are:
>
> <storage-class-type> <return-type> <function-name>(<parameter type list>);
>
No.
>
> But then
>
> extern int fcloseall(void) __THROW;
>
> does'nt seem to fit into this syntax.
Macros lie to you.