HomeFreeBSD

Define a new __alloc_size2 attribute to complement the exiting support.

Description

Define a new __alloc_size2 attribute to complement the exiting support.

At least on GCC7 calling __alloc_size(x) twice is not equivalent to
calling using the attribute once with two arguments. The later is the
documented use in GCC documentation so add a new alloc_size(n, x)
alternative to cover for the few places where it is used: basically:
calloc(3), reallocarray(3) and mallocarray(9).

Submitted by: Mark Millard
MFC after: 3 days
Reference:
http://docs.freebsd.org/cgi/mid.cgi?F227842D-6BE2-4680-82E7-07906AF61CD7

Details

Provenance
pfgAuthored on
Parents
rS328220: 8677 Open-Context Channel Programs
Branches
Unknown
Tags
Unknown