From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id B0D943858CDA for ; Fri, 30 Dec 2022 20:56:59 +0000 (GMT) X-IronPort-AV: E=Sophos;i="5.96,288,1665475200"; d="scan'208";a="94791319" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 30 Dec 2022 12:56:58 -0800 IronPort-SDR: jyLJ0dhlKkCAPAJTHELLxSCtWgnCZqOc20S0iHjOM+o20tku1sDGQsrDglDc1BXOC0DvmUVvpg hrChsOMJlo+C22qhgyumMdAlBi3b6X2ftMgiXw20a9Q+EgDmemiYfyb5kGKVqcl7XTd6cTFbTH vg95qE1pchF/zEmyS1ZRTTpShY1UBx2pnnDqiY9ffHJxiAhf/vKJfH61MIG4I2ey9BVK2i4znu BYPHUzmDqrCdF8I+t0s3COhfBQ/mCir11pOCp3WQSkxp8avN7hWWJtAM4pASxTdyXADat9btk8 0p0= Date: Fri, 30 Dec 2022 20:56:53 +0000 From: Joseph Myers To: Alejandro Colomar CC: , GNU C Library , Yann Droneaud Subject: Re: stdc_bit_ceil(3) and wrapping In-Reply-To: <9b662ccd-0f9d-963b-e1f6-d225c5a9c902@gmail.com> Message-ID: References: <8e45df-4b3e-e648-e14-b5d7ce15311f@codesourcery.com> <9b662ccd-0f9d-963b-e1f6-d225c5a9c902@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3109.2 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,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 Fri, 30 Dec 2022, Alejandro Colomar via Gcc wrote: > For the C standard, shifts have wrap around semantics for unsigned types: Only if the shift count is nonnegative and strictly less than the width of the type. This is about shifting by an amount equal to the width of the type, which has undefined behavior. -- Joseph S. Myers joseph@codesourcery.com