varnish-cache icon indicating copy to clipboard operation
varnish-cache copied to clipboard

vdef: introduce v_counted_by_(field)

Open asadsa92 opened this issue 2 years ago • 4 comments

A new attribute can be used for flexible arrays to make the compiler smarter:

  • https://clang.llvm.org/docs/AttributeReference.html#counted-by
  • https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628459.html

This would improve the array bound sanitizer.

Note: this has not been tested locally, but this should be safe until a compiler supports it. Once supported, we would detect and make the adjustments as needed.

asadsa92 avatar Jan 15 '24 13:01 asadsa92

I am generally 👍🏽 , this could potentially increase our code quality. BUT

this has not been tested locally

locally installing gcc-trunk and testing the changes should not be asking too much, rather than putting the burdon on a future incarnation of some other maintainer.

nigoroll avatar Jan 22 '24 18:01 nigoroll

this has not been tested locally

locally installing gcc-trunk and testing the changes should not be asking too much, rather than putting the burdon on a future incarnation of some other maintainer.

I agree with the reasoning to test it before merge to not uncover work later on, I was partly thinking this could be easily tested in CCI. The attribute is maybe too new. Anyways, thanks, I will look into it.

asadsa92 avatar Jan 23 '24 09:01 asadsa92

@asadsa92 , do you need help with this?

gquintard avatar Aug 16 '24 16:08 gquintard

@gquintard No, but thanks for the reminder. I have added this to my backlog, I will come to it soon.

asadsa92 avatar Aug 19 '24 07:08 asadsa92