https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Parker Thompson from comment #3)
> > As for alloc alignment, glibc strdup() does not use aligned_alloc, just
> > malloc.  Which by my read of the spec does not guarantee alignment.
> 
> malloc requires alignement of alignof(max_align_t) (definition in the newest
> C and C++ standards) but beforehand it was required to be aligned enough to
> support all standard types.

C11 is where the definition changes to use max_align_t.

https://en.cppreference.com/w/c/types/max_align_t

Reply via email to