gcc over-aligned new support (alignas )
问题 I'm having some difficulty finding more information about GCC's aligned-new warning and the gcc -faligned-new option. Compiling on gcc 7.2.0 (without --std=c++17) and trying to define an aligned struct such as: struct alignas(64) Foo { int x; } Just doing a plain old: Foo * f = new Foo(); Gives me the following warning and suggestion: alignas.cpp:36:25: warning: ‘new’ of type ‘Foo’ with extended alignment 64 [-Waligned-new=] Foo * f = new Foo(); ^ alignas.cpp:36:25: note: uses ‘void* operator