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


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();

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>);

But then

extern int fcloseall(void) __THROW;

does'nt seem to fit into this syntax.

If terms like __THROW are allowed then is it possible to use custom defined
macros like __SNODX? If only a set of reserved terms are permitted as m pointed out
then where is the list of these terms?

Thanx in advance.

Eagerly awaiting responses.

SNODX


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