Re: Using custom qualifiers like __THROW

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



snodx@xxxxxxxxxxx writes:

> Thanx michal017@xxxxxxxxxx, 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@xxxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux