Email List: Xaustin-review-lX
[All Lists]

Defect in XSH posix_memalign

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH posix_memalign
From: Geoff Clare <yyy@xxxxxxxxxxxxx>
Date: Fri, 28 May 2004 19:06:24 +0100
(Page and line numbers are for the 2004 edition.)

@ page 885 line 28831 section posix_memalign comment [gwc memalign multiple]

Problem:

Defect code :  3. Clarification required

This wording in the description of posix_memalign() is ambiguous:

    "The value of alignment shall be a multiple of sizeof(void *),
    that is also a power of two."

It can be interpreted as meaning that the value of alignment must
be a power of two, but presumably what it really means is that the
multiple must be a power of two, as implied by the wording of
the EINVAL error:

    "The value of the alignment parameter is not a power of two
    multiple of sizeof(void *)."

It would not make any sense to require that the value of alignment
must be a power of two and must also be a multiple of sizeof(void *),
as that would be impossible if sizeof(void *) is not a power of two.

Action:

Change "shall be a multiple of sizeof(void *), that is also a power
of two" to "shall be a power of two multiple of sizeof(void *)".

<Prev in Thread] Current Thread [Next in Thread>