From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra.cs.ucla.edu (zimbra.cs.ucla.edu [131.179.128.68]) by sourceware.org (Postfix) with ESMTPS id 5E1383858D28 for ; Tue, 17 Jan 2023 21:53:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E1383858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C4B4B16004F; Tue, 17 Jan 2023 13:53:45 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3dGckxSpoATX; Tue, 17 Jan 2023 13:53:45 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1AA1016005E; Tue, 17 Jan 2023 13:53:45 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 1AA1016005E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1673992425; bh=oCa4OrKaaSVFXgJXH/bWyrWoEmDf2N4eGl+YKoYuVr0=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type: Content-Transfer-Encoding; b=G+FbqalMDzf4a/i+trZdFQ/I7T9ldCXWs4pcBysDYY3MzPOscRkvBB2ePEVEjgeXF u5b6BxZ/vSaJuIjvnTMN+BJ55lCq+8vwN3vj6/cs0/iRwGkzP/crIIW/+fLHwxpE/8 oFtJXTCdA9g75HtBd0giUTERNts5NZDvg7ev8TDc= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6XXD6VvW4XEz; Tue, 17 Jan 2023 13:53:45 -0800 (PST) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id EC44216004F; Tue, 17 Jan 2023 13:53:44 -0800 (PST) Message-ID: Date: Tue, 17 Jan 2023 13:53:44 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [RFC] roundup.3: New page documenting roundup(3) (was: bug in roundup(3) from ) Content-Language: en-US To: Alejandro Colomar , Wilco Dijkstra , Adhemerval Zanella Cc: 'GNU C Library' References: <59e67ba9-a379-16e9-3300-8f7d6114bf5c@cs.ucla.edu> <9d821d48-8ea9-7af6-10c7-0fc222437191@gmail.com> From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,JMQ_SPF_NEUTRAL,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/17/23 12:24, Alejandro Colomar wrote: >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This=C2=A0 macro=C2=A0 produces=C2= =A0 incorrect values when x + step would=20 > overflow or > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 wrap around The macro can have undefined behavior on overflow, if the result type is=20 signed. So I suggest replacing "produces incorrect values" with "has=20 undefined behavior". I suppose you could also document that the behavior is well-defined if=20 the result type is unsigned, but that sounds like overkill.