Problem with calling conventions.

Erik Mouw J.A.K.Mouw@its.tudelft.nl
Fri Dec 31 23:54:00 GMT 1999


On Fri, 24 Dec 1999 17:16:41 +0530 (IST), Mansoor Peerbhoy wrote:
> I have a problem. The following line of code gives me an error when
> compiled by a gcc2.95.2 compiler on AiX 4.3.2.
> int __cdecl foo ();
> I cannot even use __stdcall, for that matter.
> Can anyone please tell me how to specify the calling convention while
> declaring a function ?

You should declare your function as:

  int foo() __attribute__ ((cdecl));

Have a look at the gcc info files for more information (the section
about "Declaring Attributes of Functions").


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/





More information about the Gcc mailing list