Reputation: 40499
When I compile the following C source with gcc
version 8.1.1, I get a warning: ‘stdcall’ attribute ignored [-Wattributes]
.
Why does gcc choose to ignore this attribute and what can I do to make it accept it?
__attribute__((stdcall)) int S(int a) {
return a * (a+1);
}
int main() {
return S(6);
}
Upvotes: 8
Views: 4968
Reputation: 85767
The gcc documentation says:
stdcall
On x86-32 targets, the
stdcall
attribute causes the compiler to assume that the called function pops off the stack space used to pass arguments, unless it takes a variable number of arguments.
(Emphasis mine.)
So if you're not compiling for a 32-bit machine, stdcall
can't be used.
Upvotes: 8