Using custom qualifiers like __THROW

snodx@hotmail.com snodx@hotmail.com
Thu Jul 17 12:28:00 GMT 2003


Dear list,

I was browsing the stdio.h file, on my Redhat 8.0 machine, when
I came across the following line:

extern int fcloseall(void) __THROW;

Now I know about fcloseall(void) but I was perturbed to see the term __THROW.
After studying a bit I came to know that it actually expands to
the function throw()

I did not get the definition of throw() anywhere so left it that. So I asked
to myself if a __THROW could be allowed after a function declaration why
not something like __SNODX which expands to say a function like
snodx().

So I ran the command gcc -o snodx snodx.c where snodx.c contains:

#include<stdio.h>                        LINE 1
                                         LINE 2
#define __SNODX void snodx(){return;}    LINE 3
                                         LINE 4
int square_func(int) __SNODX;            LINE 5
                                         LINE 6
int square_func(int l){return(l*l);}     LINE 7
                                         ......
int main()                               ......
{                                        ......
 printf("%d\n",square_func());           ......
 return 0;                               ......
}                                        ......

I am getting the following compile-time errors

5: parse error before '{' token

5: declaration for parameter `snodx' but no such parameter

5: number of arguments does'nt match
cc1: prototype declaration

What am I doing wrong here?

Terms like __THROW do not appear in stdio.h of other compilers like Borland
or Turbo C++ compilers

Thanx in advance.

Eagerly awaiting responses.

SNODX

PS: I searched Google for this but I am not getting anything. The search is
    continuing



More information about the Gcc-help mailing list