Issue 170987
Summary "counted_by" behavior is different in clang than gcc for a signed element count
Labels clang
Assignees
Reporter vabridgers
    I was exploring the similarities and differences between the clang and gcc implementations for "counted_by" attribute support and came across the following difference in behavior. 

```
#include <stdlib.h>

struct signed_struct {
  int b;
  int c[] __attribute__ ((counted_by (b)));
} *psigned_struct;

int main(int argc, char *argv[])
{

  struct signed_struct *ps = (struct signed_struct *) malloc(sizeof(struct signed_struct));
  ps->b = -3;
  ps->c[2] = 0;

  return 0;
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to