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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gitlab.com/wireshar
                   |                            |k/wireshark/-/merge_request
                   |                            |s/15925

--- Comment #19 from Sam James <sjames at gcc dot gnu.org> ---
Sorry, that feels obvious in hindsight.

commit 365a8212989ef0ef506969631617175a2464302f
Author: Darius Davis <darius-wiresh...@free-range.com.au>
Date:   Mon Jun 10 20:50:51 2024 +1000

    wmem: Remove G_GNUC_MALLOC from wmem_realloc and wmem_memdup.

    The documentation for GCC's __attribute__((malloc)) [1] says specifically
that
    this attribute should not be used on realloc-like functions because "they
may
    return pointers to storage containing pointers to existing objects" which
can
    cause the compiler to make incorrect assumptions about pointer aliasing, so
    let's remove G_GNUC_MALLOC from wmem_realloc.

    wmem_memdup meets the same criterion, so G_GNUC_MALLOC is removed from that
    function too.

    [1]
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-functions-that-behave-like-malloc

I'll send a followup for wmem_tree_new_autoreset.

Reply via email to