From patchwork Wed Aug 7 18:36:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 1970200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WfJnF0Hs2z1ydt for ; Thu, 8 Aug 2024 04:37:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5851385C6D2 for ; Wed, 7 Aug 2024 18:37:18 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dellerweb.de (unknown [IPv6:2a02:c207:3003:236::1]) by sourceware.org (Postfix) with ESMTPS id ABF30385C6C2 for ; Wed, 7 Aug 2024 18:37:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABF30385C6C2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=parisc-linux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=parisc-linux.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ABF30385C6C2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a02:c207:3003:236::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723055822; cv=none; b=UUyjGDhd6R2IYNCj4Vy4xkjs9OZxmgTVrlixIBmT1oNzeSx9Fn94UE9rrVntf9r52b4Z1Eizpyu9V2sExGT0HiNFmjEW09RFqw7DzUPLibRkCmeX9rpttP8n6rIGNcUuyr1mMvcUcdjvZjTRj7sYDljMLgx0xa1EwCZu9ukrrmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723055822; c=relaxed/simple; bh=s3yRoGb/6MT/lxtlhJ3Zz4azCr5DyntxOBL3OqfZZc4=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=o4v7rhXhF9HuuQ4WZ2uAKteQoqR5VPG/o4cezJOEWcqcgJ+djxmVXRDnUqGG4bSpyL9DDSF0L6PWJRZ2AGFLW6PzJxlF55O1wLinsnOLyp+GtWDMChp+kV0iwELtXrztWqy38N0t6w2nxH4LfzgmMbep8AoLxlECneZBKcsWiA8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mx3210.localdomain (unknown [76.71.115.75]) by dellerweb.de (Postfix) with ESMTPSA id D17C916001D0; Wed, 7 Aug 2024 20:36:57 +0200 (CEST) Received: by mx3210.localdomain (Postfix, from userid 1000) id 1563AD60090; Wed, 7 Aug 2024 14:36:55 -0400 (EDT) Date: Wed, 7 Aug 2024 14:36:55 -0400 From: John David Anglin To: libc-alpha@sourceware.org Subject: [PATCH] Fix compiler warnings in stdio-common/_itoa.c and stdio-common/_itowa.c Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org This changes fixes several warning seen building glibc on hppa-linux-gnu. Okay for master? Dave --- Fix compiler warnings in stdio-common/_itoa.c and stdio-common/_itowa.c diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c index 36f9c177e8..3cf385229f 100644 --- a/stdio-common/_itoa.c +++ b/stdio-common/_itoa.c @@ -340,8 +340,8 @@ _itoa (unsigned long long int value, char *buflim, unsigned int base, if (big_normalization_steps == 0) xh = 0; else - xh = (mp_limb_t) (value >> 64 - big_normalization_steps); - xl = (mp_limb_t) (value >> 32 - big_normalization_steps); + xh = (mp_limb_t) (value >> (64 - big_normalization_steps)); + xl = (mp_limb_t) (value >> (32 - big_normalization_steps)); udiv_qrnnd (x1hi, r, xh, xl, big_base_norm); xl = ((mp_limb_t) value) << big_normalization_steps; @@ -352,7 +352,7 @@ _itoa (unsigned long long int value, char *buflim, unsigned int base, xh = x1hi; else xh = ((x1hi << big_normalization_steps) - | (x1lo >> 32 - big_normalization_steps)); + | (x1lo >> (32 - big_normalization_steps))); xl = x1lo << big_normalization_steps; udiv_qrnnd (t[0], x, xh, xl, big_base_norm); t[1] = x >> big_normalization_steps; diff --git a/stdio-common/_itowa.c b/stdio-common/_itowa.c index 53a6cb64e6..7a4b216a13 100644 --- a/stdio-common/_itowa.c +++ b/stdio-common/_itowa.c @@ -228,8 +228,8 @@ _itowa (unsigned long long int value, wchar_t *buflim, unsigned int base, if (big_normalization_steps == 0) xh = 0; else - xh = (mp_limb_t) (value >> 64 - big_normalization_steps); - xl = (mp_limb_t) (value >> 32 - big_normalization_steps); + xh = (mp_limb_t) (value >> (64 - big_normalization_steps)); + xl = (mp_limb_t) (value >> (32 - big_normalization_steps)); udiv_qrnnd (x1hi, r, xh, xl, big_base_norm); xl = ((mp_limb_t) value) << big_normalization_steps; @@ -240,7 +240,7 @@ _itowa (unsigned long long int value, wchar_t *buflim, unsigned int base, xh = x1hi; else xh = ((x1hi << big_normalization_steps) - | (x1lo >> 32 - big_normalization_steps)); + | (x1lo >> (32 - big_normalization_steps))); xl = x1lo << big_normalization_steps; udiv_qrnnd (t[0], x, xh, xl, big_base_norm); t[1] = x >> big_normalization_steps;