1.volatile: tells the compiler that I can change at any time, each time it is used, it must be read from the address of I (memory), instead of using the cache value in the Register;
volatileint i=10
2.Register: The variable declared with the modifier register belongs to the Register storage type. This type is similar to the automatic storage type and has an automatic storage period, code block scope, and internal connection. Declaring a register is just a request, so the variable may still be a normal automatic variable. In either case, a variable modified with register cannot get an address. If it is not initialized, its value is undefined.
3.Restrict: The keyword restrict is used only to qualify pointers, which is used to tell the compiler that all actions that modify the pointer to the content are based on the pointer (base on) , that there is no other way to modify the operation The consequence is to help the compiler do better code optimization and generate more efficient assembly code.
int *restrict//只会通过指针 x,对 x 中的值进行修改
Reference: http://blog.csdn.net/lovekatherine/article/details/1891806
4. __attribute__
: You can set function properties (functions Attribute), variable properties (Variable Attribute), and type properties (types Attribute).
externvoid myexit() __attribute__((noreturn));//表示函数不存在返回值;编译不会再出现警告信息。
Reference: http://blog.csdn.net/ruixj/article/details/4274721
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Special keywords in c/C + +: Volatile, register, restrict, __attribute__