Chinaunix首页 | 论坛 | 博客
  • 博客访问: 136616
  • 博文数量: 75
  • 博客积分: 3483
  • 博客等级: 中校
  • 技术积分: 820
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-07 08:31
文章分类

全部博文(75)

文章存档

2011年(53)

2010年(22)

我的朋友

分类:

2011-01-11 19:55:16

libc_hidden_proto causes the symbol to lose its special attributes,
e.g. if it had __attribute__((noreturn)).  For noreturn this meanings
spurious warnings in libc code, but for const it could hurt optimization
and for any weirder ones (regparm!) it could really be a problem.
I cannot reproduce this for const or regparm.  These are the two I tried.

extern int foo (int) __attribute ((regparm (1), const));
//extern int bar (int) __attribute ((regparm (1), const));
__typeof (foo) __foo;
__typeof (foo) foo __asm ("__foo") __attribute ((visibility ("hidden")));
int
foo (int a)
{
  return a;
}
int
bar (int a)
{
  return a;
}
int
xyzzy (int a)
{
  return foo (a) == 1 || foo (a) == 2;
}
int
xyzzy2 (int a)
{
  return bar (a) == 1 || bar (a) == 2;
}
阅读(1887) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~