I see added risk and added incompatibility with GCC, but no added
value. I'd prefer that this go in as a Decl-only attribute for now,
and we can revisit making it a type attribute down the road if we see
any benefits.

I wrote a small testcase to check what gcc does. Compiling it with gcc I get a warning

warning: ‘returns_twice’ attribute ignored

and if optimizations are enabled both h1 and h3 are tail called, so it looks like gcc uses this as an decl only attribute. I will try to implement that.

- Doug

Cheers,
Rafael
void g1(void);
void h1(void);

void f1(void) {
  g1();
  h1();
}

void g2(void) __attribute__((returns_twice));
void h2(void);

void f2(void) {
  g2();
  h2();
}

typedef void (*g3_t)(void) __attribute__((returns_twice));
g3_t g3;
void h3(void);

void f3(void) {
  g3();
  h3();
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to