This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
stdcall function attribute doesn't work any longer
- To: gcc-bugs at gcc dot gnu dot org
- Subject: stdcall function attribute doesn't work any longer
- From: Matthias Klose <doko at cs dot tu-berlin dot de>
- Date: Sat, 21 Aug 1999 19:48:56 +0200 (MET DST)
- Cc: markus dot oberhumer at jk dot uni-linz dot ac dot at, 43119 at bugs dot debian dot org
- References: <XFMail.990817183617.markus.oberhumer@jk.uni-linz.ac.at>
[This bug/behaviour was reported to me as a co-maintainer of the
Debian GNU/Linux GCC packages. Please Cc: 43119@bugs.debian.org in
your response so it gets archived in the Debian bugtracking system
(http://www.debian.org/Bugs/db/43/43119.html).]
Markus F.X.J. Oberhumer writes:
> Package: gcc
> Version: 2.95.1-0pre1
>
> gcc exits with a "conflicting types" error when
> compiling the code below.
>
> Markus
>
> int foo1(void) __attribute__((stdcall));
> int foo1(void)
> {
> return 1;
> }
>
> int foo2(void) __attribute__((__stdcall__));
> int foo2(void)
> {
> return 2;
> }
In the documentation ("Declaring Attributes of Functions"), I find:
"The keyword `__attribute__' allows you to specify special attributes
when making a declaration." However if the attribute is repeated at the
definition of the function, I get an parse error (according to the
documentation):
int foo1(void) __attribute__((stdcall));
int foo1(void) __attribute__((stdcall))
{
return 1;
}
bug-43119-2.c:3: parse error before `{'
When using the now undocumented way of moving the attribute before the
function name, neither the parse error nor the type conflict occur:
int foo1(void) __attribute__((stdcall));
int __attribute__((stdcall)) foo1(void)
{
return 1;
}