george.burgess.iv abandoned this revision.
george.burgess.iv added a comment.

I don't feel strongly about how we should handle this, to be honest. Feeding 
your example into GCC 4.8 like so:

  #include <stdio.h>
  
  struct Foo { char k[1]; };
  
  struct Bar : Foo {};
  
  int __attribute__((noinline)) bos(Bar *b) {
    return __builtin_object_size(&b->k[0], 1);
  }
  
  int main() {
    Bar b;
    printf("%d\n", bos(&b));
    return 0;
  }

...The resultant executable prints "1". So, it seems that having this detection 
would be above and beyond what GCC offers. Given that "above and beyond," in 
this case implies "less likely to produce an accurate answer," I agree that 
this probably isn't such a great idea. :)

Thanks for the feedback!


http://reviews.llvm.org/D17746



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to