This is the mail archive of the gcc-help@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: Using custom qualifiers like __THROW


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.


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