rapidsna wrote:

> @kees, @nickdesaulniers, @rapidsna, and @apple-fcloutier Should this feature 
> support a `__bdos` to an address inside the FAM?
> 
> ```
> #include <stdio.h>
> #include <stdlib.h>
> 
> struct flex {
>         double dummy;
>         char count;
>         char fam[] __attribute__((counted_by(count)));
> };
> 
> int main() {
>         struct flex *f = malloc(sizeof(struct flex) + 42 * sizeof(char));
> 
>         f->count = 42;
>         printf("__bdos(&f->fam[3], 1) == %lu\n", 
> __builtin_dynamic_object_size(&f->fam[3], 1));
>         return 0;
> }
> ```

Supporting it similar to how const-sized arrays are currently handled makes 
sense to me.

https://github.com/llvm/llvm-project/pull/70606
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to