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

--- Comment #8 from Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> ---
(In reply to Martin Uecker from comment #7)
> For __builtin_with_access we probably only want to allow
> reducing the object size, while the 'extend_size' workaround 
> used by systemd (cf comment #4) would need to extend it. 
> Maybe we need another flag?

I've been thinking of a new __object_size__ attribute to annotate functions
that behave like __builtin_object_size so that calls to it override (and not
just reduce) sizes returned by allocations.  I can then use it to annotate a
supported malloc_usable_size replacement (say, malloc_size_estimate) that
actually works like __builtin_object_size and can then be used by systemd.

Reply via email to