This is the mail archive of the gcc-bugs@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]

stdcall function attribute doesn't work any longer


[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; 
} 


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