From: Patrick J. L. <lop...@gm...> - 2012-07-26 20:57:54
|
On Thu, Jul 26, 2012 at 11:12 AM, Sean McBride <se...@ro...> wrote: > > I think it's definitely worth a bug report. If nothing else, the man page should discuss whether a zero size is undefined behaviour or not. The POSIX spec makes it pretty clear that this is not undefined behavior: http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html "If the size of the space requested is 0, the behavior is implementation-defined; the value returned in memptr shall be either a null pointer or a unique pointer." and "The free() function shall deallocate memory that has previously been allocated by posix_memalign()." Geoffrey is right; this is unambiguously a bug in Apple's C library. Nice catch. - Pat |