[cfe-commits] patch: warn on allocating over-aligned objects

Matt Beaumont-Gay matthewbg at google.com
Tue Dec 20 10:56:42 PST 2011


On Fri, Dec 16, 2011 at 19:03, Nick Lewycky <nlewycky at google.com> wrote:
> The attached patch warns on new expressions for types that are
> over-allocated, when the "operator new" that will be called is not
> overridden. Either the operator new in the class or in the global space can
> override, unless it's a global operator new from a system header. This
> addresses PR9527.
>
> pr9527-2.cc:13:3: warning: type 'Test' requires 64 bytes of alignment and
> the
>       default allocator only guarantees 16 bytes [-Woveraligned]

I would expect this to be termed "underalignment" rather than "overalignment".

Otherwise, the patch looks pretty reasonable.

-Matt




More information about the cfe-commits mailing list