From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 8B311385783D for ; Thu, 21 Oct 2021 15:41:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B311385783D Received: by mail-wm1-x32e.google.com with SMTP id l38-20020a05600c1d2600b0030d80c3667aso77427wms.5 for ; Thu, 21 Oct 2021 08:41:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=FyF6u8AFF+iEOAd50YLQFtSaHANUr0U3gIJ2rBUQJb4=; b=S3Pw0sS688wb5W5aUUB18nE/7j6ApghkxR76M58+sVxCUc/xPexeMxVHfsA/tk3nNl PogjAS8S8TeDNINRXGQyTyzFeth8lcRFHn/dAs5MLSn8iSlP7v56S0boKJiMAX45p/CE FIZB8tFVTaQ0BMOtdveCiiyaGZhgwSebqCCI66R6IprDu0dcqJfUj8HLUJvDlOxxXiZv JNuUSN5CDH9iJugysFcVMpZXNBM6Tq26Z5yCSSbjfnlpUIcfqovn56yzG/EktSbLW5n4 wsrAMjSDMtWl9TjIGrOhtt5O74U2fP1HuTIMum4aZMXUJqTO1cIKQSpnvbQnpMDnSp0Y VQFw== X-Gm-Message-State: AOAM5323hKs1OyYNovs3OUeqjxdwHpTXTGGcMSiZyP9aqN5ZIbnCvMK8 LMidojhWgDwQiTXv6xt67fg= X-Google-Smtp-Source: ABdhPJz3sAQNk5sJ9/fKH5oCn36sbTSuaSk6kdj8TCk0aDh6iHmNSIEsQ8hVbZNEGjWqQDbUrsKNkQ== X-Received: by 2002:a05:600c:d3:: with SMTP id u19mr7740560wmm.153.1634830899683; Thu, 21 Oct 2021 08:41:39 -0700 (PDT) Received: from [10.8.0.138] ([195.53.121.100]) by smtp.gmail.com with ESMTPSA id f20sm6085910wmq.38.2021.10.21.08.41.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Oct 2021 08:41:39 -0700 (PDT) Subject: Re: [PATCH] manual: remove an obsolete requirement on aligned_alloc() usage To: John Scott , libc-alpha@sourceware.org References: <33ec9e0c1e587813b90e8aa771c2c8e6e379dd48.camel@posteo.net> From: "Alejandro Colomar (man-pages)" Message-ID: Date: Thu, 21 Oct 2021 17:41:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <33ec9e0c1e587813b90e8aa771c2c8e6e379dd48.camel@posteo.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2021 15:41:42 -0000 Hi John, On 10/21/21 11:28 AM, John Scott via Libc-alpha wrote: > 0001-manual-remove-an-obsolete-requirement-on-aligned_all.patch > > From 315c821421a2279d77e846bf927b7c4107e32d43 Mon Sep 17 00:00:00 2001 > From: John Scott > Date: Thu, 21 Oct 2021 05:20:55 -0400 > Subject: [PATCH] manual: remove an obsolete requirement on aligned_alloc() > usage > > The C11 standard made it undefined behavior if the size of > the allocation was not a multiple of the page size. As discussed > at BZ #20137, changes to the standard were proposed and > subsequently adopted in Defect Report 460. Was that fixed in C17? Or in (yet unreleased) C2X? > > In particular, the following sentence > "The value of alignment shall be a valid alignment supported by > the implementation and the value of size shall be an integral > multiple of alignment." > was changed to > "If the value of alignment is not a valid alignment supported by > the implementation the function shall fail by returning a null pointer." Did any implementation make use of that Undefined Behavior prior to its fix? If so, at least in the man-pages, we should keep a historical note to warn about it. Thanks, Alex > > The DR is at > http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_460 > --- > manual/memory.texi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/manual/memory.texi b/manual/memory.texi > index 0b2b9c87..5c16f7ae 100644 > --- a/manual/memory.texi > +++ b/manual/memory.texi > @@ -995,7 +995,7 @@ power of two than that, use @code{aligned_alloc} or @code{posix_memalign}. > @c Alias to memalign. > The @code{aligned_alloc} function allocates a block of @var{size} bytes whose > address is a multiple of @var{alignment}. The @var{alignment} must be a > -power of two and @var{size} must be a multiple of @var{alignment}. > +power of two. > > The @code{aligned_alloc} function returns a null pointer on error and sets > @code{errno} to one of the following values: > -- 2.33.0 -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/