ChinaUnix.net
相关文章推荐:

declared with attribute warnunuserdresulte gcc

__attribute__((bitwise)) __attribute__((force)) 是什么意思? 在gcc文档中没有找到。 他们用来在big-endian 和 little-edian 之间做强制转换

by zqy2000zqy - C/C++ - 2006-05-30 14:52:26 阅读(993) 回复(2)

相关讨论

我觉得gcc中的关键字__attribute__和有意思,其用处也很广范,十分希望哪位老师讲述讲述!

by sc_px_jiangyun - 程序开发 - 2006-04-07 10:58:38 阅读(854) 回复(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不矛...

by 塑料袋 - C/C++ - 2008-01-05 11:45:19 阅读(13906) 回复(5)

代码如下 [code] #include extern void eprintf(const char *format, ...) __attribute__((format(printf, 1, 2))); int main() { eprintf("%s\n", "hello"); } [/code] 编译报错 [code] gcc -o main a.c /tmp/ccQNgN4U.o: In function `main':a.c:(.text+0x2c):对‘eprintf’未定义的引用collect2: ld returned 1 exit status [/code] 请教如何解决?

by chzht001 - C/C++ - 2006-12-20 18:05:52 阅读(1940) 回复(4)

关于属性 类属性实际上上包括数据属性和非数据属性(也就是函数),大家都知道他们是分开的,也就是是用方法来控制数据属性,今天我给大家展示一下这方便的高级的应用。 怎么样来获取一个随机数呢,很简单,调用random里的函数就是了。可是我下面就向大家展示关于今天的主角:属性。 例子-1:(设定一个可以自动变化的类属性) -----------------------------------------------------------------------------------> import o...

by wojiaohesen - Python - 2009-06-19 08:20:20 阅读(3966) 回复(7)

//源文件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 - ...

by qinquan - C/C++ - 2008-09-24 14:52:26 阅读(1441) 回复(3)

最近在作代码移植的时候发现有这样的代码: int i attribute_unused; 请大家帮我看看这是啥意思,谢谢了! ps:我在网上查说是防止编译时候warning的,但是具体的就不清楚了.

by dxj_1231 - C/C++ - 2012-02-07 13:29:05 阅读(4819) 回复(2)

我想用__attribute__ ((packed)) 限定一格头文件中的结构按照字节对齐,不知道该如何做?! 请高手赐教!

by sleetboy - C/C++ - 2007-09-18 10:18:39 阅读(4758) 回复(4)

提示这种信息是不是就是objectClass不对?

by zijian1984 - 服务器应用 - 2007-04-17 09:21:00 阅读(3128) 回复(1)

定义了一个数据结构如下 struct __attribute__((packed)) { } 如何理解attribute在此处的意思?谢了

by 奋斗的蕃茄 - C/C++ - 2006-07-19 15:03:32 阅读(993) 回复(2)