Attribute for custom memset function
NightStrike
nightstrike@gmail.com
Wed Sep 10 01:16:20 GMT 2025
On Mon, Sep 8, 2025, 03:47 Chris Packham via Gcc <gcc@gcc.gnu.org> wrote:
> Hi GCC,
>
> For various reasons I find myself working with a few code bases that define
> their own wrappers for memset(). Unfortunately these wrappers defeat gccs
> ability to detect when the size of the pointer is passed instead of the
> size of the pointed to object.
>
> Is there any attribute I can set on the memset like functions that will let
> gcc know to perform the same kinds of checks as the standard memset
> function?
>
> Thanks,
> Chris
>
Would nonnull_if_nonzero help?
>
More information about the Gcc
mailing list