GCC __attribute__ meaning (reference for HTTPS://GCC.GNU.ORG/ONLINEDOCS/GCC-3.2/GCC/FUNCTION-ATT)

Source: Internet
Author: User
Busybox/src/include/platform.h
/* Fast_func is a qualifier which (possibly) makes function call faster
 * and/or smaller by using modified ABI. It is usually only needed
 * on non-static, busybox internal functions. Recent versions of GCC
 * optimize statics automatically. Fast_func on the static is required
 * only if your need to match a function pointer ' s type * * *
#if __gnuc_prereq (3,0) &A mp;& defined (i386)/* | | Defined (__x86_64__)? *////
* stdcall makes callee to POPs arguments from stack, not caller/
# define FAST_FUNC (__attribute__ (3) stdcall))
/* #elif ...-add your favorite arch today!/
#else
# define Fast_func
#endif
This statement is often used in BusyBox: Look at the definition format of the Fast_func property function:
In the GCC compiler
The Meaning of __attribute__ ((Regparm (3), stdcall) is:
Regparm (number)
On the Intel 386, The regparm attribute causes the compiler to pass up to number integer arguments in Registers EAX, EDX, and ECX instead of on the stack. Functions that take a variable number of arguments would continue to is passed all of their arguments on the stack.  s Tdcall on the Intel 386, The stdcall attribute causes the compiler to assume this called function would pop O FF the stack spaces used to pass arguments, unless it takes a variable number of arguments.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.