This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Using custom qualifiers like __THROW
- From: snodx at hotmail dot com
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 17 Jul 2003 17:29:54 +0530
- Subject: Using custom qualifiers like __THROW
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