http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60092

--- Comment #23 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot 
Uni-Bielefeld.DE> ---
> --- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> (In reply to Rainer Orth from comment #21)
>> The new test FAILs on Solaris 11 (both SPARC and x86), which, unlike Solaris
>> 10,
>> has posix_memalign in libc:
>> 
>> FAIL: gcc.dg/torture/pr60092.c  -O0  execution test
>> 
>> The posix_memalign invocation with size = -1 cannot be right, and indeed the
>> function returns ENOMEM.
>
> The invocation uses size -1 intentionally, and expects ENOMEM, but if Solaris
> libc stores to what the first argument points to even when it fails, then it
> violates POSIX.

POSIX.1 doesn't explicitly forbid setting *memptr on error:

http://pubs.opengroup.org/onlinepubs/007904975/functions/posix_memalign.html

But I agree it seems strange, and in the OpenSolaris sources you see
that *memptr is set to the memalign() return value (NULL in this case).

    Rainer

Reply via email to