This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH] Add alloc_size attribute to the default operator new and operator new[]


On Wed, Aug 03, 2011 at 03:55:39PM +0200, Richard Guenther wrote:
> On Wed, Aug 3, 2011 at 3:06 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> > On 08/03/2011 02:46 PM, Richard Guenther wrote:
> >>
> >> If that's reasonable then adding the malloc attribute should be, too.
> >
> > Making aliasing stricter for -D_FORTIFY_SOURCE=2 sounds wrong though.
> 
> The patch unconditionally adds malloc_size.

alloc_size, yeah, unconditionally, on the other side it is used just
by __builtin_object_size which is used (usually) only for
-D_FORTIFY_SOURCE*.

I wanted to separate alloc_size attribute issue from malloc (where I'd
surely prefer also adding it by default and having an option to disable it
for weird C++ sources), because with -D_FORTIFY_SOURCE* or
__builtin_object_size one has to request it specially and/or use extensions
and thus not be that tighly bound by the standard.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]