Date: Wed, 24 Jan 2018 00:11:46 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328308 - stable/11/sys/sys Message-ID: <201801240011.w0O0Bk5S036953@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Wed Jan 24 00:11:46 2018 New Revision: 328308 URL: https://svnweb.freebsd.org/changeset/base/328308 Log: MFC r328221: Define a new __alloc_size2 attribute to complement the existing 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 Modified: stable/11/sys/sys/cdefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Tue Jan 23 23:30:19 2018 (r328307) +++ stable/11/sys/sys/cdefs.h Wed Jan 24 00:11:46 2018 (r328308) @@ -239,8 +239,10 @@ #endif #if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__) #define __alloc_size(x) __attribute__((__alloc_size__(x))) +#define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x))) #else #define __alloc_size(x) +#define __alloc_size2(n, x) #endif #if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__) #define __alloc_align(x) __attribute__((__alloc_align__(x)))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801240011.w0O0Bk5S036953>