https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87683
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid, | |diagnostic, documentation Status|UNCONFIRMED |NEW Last reconfirmed| |2018-10-22 Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- You cannot use alloc_align on posix_memalign, alloc_align only works for functions that _return_ the allocated pointer (likewise alloc_size). We should probably diagnose this based on the return value being 'int' and not a pointer. Confirmed as diagnostic issue. Quoting docs: item alloc_size @cindex @code{alloc_size} function attribute The @code{alloc_size} attribute is used to tell the compiler that the function return value points to memory, where the size is given by ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @item alloc_align @cindex @code{alloc_align} function attribute The @code{alloc_align} attribute is used to tell the compiler that the function return value points to memory, where the returned pointer minimum ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^