https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127898

--- Comment #2 from Collin Funk <collin.funk1 at gmail dot com> ---
I understand now, thanks for the explanation. I guess I wasn't focused enough
on the counted_by relation, but that makes sense now.

I'm not sure how difficult that change would be, but I think it is worth
handling this case. There are a few similar cases in GNU coreutils that will
trigger this, so it certainly exists in other projects as well.

To work around it, I just wrote:

```
  idx_t const row_idx = table.nrows++;
  table.rows[row_idx] = xinmalloc (table.ncolumns, sizeof *table.rows[0]);
```

But,as Pádraig said [1], it is a bit annoying that the temporary variable is
needed.

My hope is that removing gotchas like this will help counted_by, and related
attributes, be adopted and improved.

[1] https://lists.gnu.org/archive/html/coreutils/2026-10/msg00076.html

Reply via email to