__attribute__((bitwise)) __attribute__((force)) 是什么意思? 在gcc文档中没有找到。 他们用来在big-endian 和 little-edian 之间做强制转换
by zqy2000zqy - C/C++ - 2006-05-30 14:52:26 阅读(993) 回复(2)
ld.so里有这么句代码 [code] /* If we would use strong_alias here the compiler would see a non-hidden definition. * This would undo the effect of the previous declaration. *So spell out was strong_alias does plus add the visibility attribute. */ extern struct rtld_global _rtld_local __attribute__ ((alias ("_rtld_global"), visibility ("hidden"))); [/code] 这句话什么意思? extern和hidden不矛...
代码如下
[code]
#include
关于属性 类属性实际上上包括数据属性和非数据属性(也就是函数),大家都知道他们是分开的,也就是是用方法来控制数据属性,今天我给大家展示一下这方便的高级的应用。 怎么样来获取一个随机数呢,很简单,调用random里的函数就是了。可是我下面就向大家展示关于今天的主角:属性。 例子-1:(设定一个可以自动变化的类属性) -----------------------------------------------------------------------------------> import o...
//源文件test_attribute.c extern void myprint(const char *format,...) __attribute__((format(printf,1,2))); void test() { myprint("i=%d\n",6); myprint("i=%s\n",6); myprint("i=%s\n","abc"); myprint("%s,%d,%d\n",1,2); } int main(int argc,char **argv) { test(); } //编译test_attribute.c arm-uclinux-gcc -DDEBUG -Wall -Os -fstrict-aliasing -msoft-float -march=armv5 - ...
最近在作代码移植的时候发现有这样的代码: int i attribute_unused; 请大家帮我看看这是啥意思,谢谢了! ps:我在网上查说是防止编译时候warning的,但是具体的就不清楚了.